From cf2952358cd22db4e79141b0177a1789d1d950dd Mon Sep 17 00:00:00 2001 From: adash Date: Wed, 14 Mar 2007 00:40:20 +0000 Subject: [PATCH] small changes, prevent memory leak, add free and change cachehashtable_t to chashtable --- Robust/src/Runtime/DSTM/interface/clookup.c | 1 + Robust/src/Runtime/DSTM/interface/dstm.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Robust/src/Runtime/DSTM/interface/clookup.c b/Robust/src/Runtime/DSTM/interface/clookup.c index 4fd11cbe..aa014698 100644 --- a/Robust/src/Runtime/DSTM/interface/clookup.c +++ b/Robust/src/Runtime/DSTM/interface/clookup.c @@ -13,6 +13,7 @@ chashtable_t *chashCreate(unsigned int size, float loadfactor) { // Allocate space for the hash table if((nodes = calloc(size, sizeof(chashlistnode_t))) == NULL) { printf("Calloc error %s %d\n", __FILE__, __LINE__); + free(ctable); return NULL; } diff --git a/Robust/src/Runtime/DSTM/interface/dstm.h b/Robust/src/Runtime/DSTM/interface/dstm.h index d7278ea6..fdfd0951 100644 --- a/Robust/src/Runtime/DSTM/interface/dstm.h +++ b/Robust/src/Runtime/DSTM/interface/dstm.h @@ -26,7 +26,7 @@ typedef struct objstr { typedef struct transrecord { objstr_t *cache; - cachehashtable_t *lookupTable; + chashtable_t *lookupTable; } transrecord_t; /* Initialize main object store and lookup tables, start server thread. */ -- 2.34.1