fix memory leak
authorbdemsky <bdemsky>
Thu, 9 Apr 2009 06:58:34 +0000 (06:58 +0000)
committerbdemsky <bdemsky>
Thu, 9 Apr 2009 06:58:34 +0000 (06:58 +0000)
Robust/src/Runtime/STM/stm.c

index 1c6af83bde94b2224defc702cf7b2aad6525b045..6cf89a74754d24fb8bfa98cef7fddce02ca35f52 100644 (file)
@@ -137,7 +137,7 @@ void *objstrAlloc(objstr_t **osptr, unsigned int size) {
     unsigned int newsize=size>DEFAULT_OBJ_STORE_SIZE?size:DEFAULT_OBJ_STORE_SIZE;
     objstr_t *os=(objstr_t *)calloc(1,(sizeof(objstr_t) + newsize));
     void *ptr=&os[1];
-    os->next=store;
+    os->next=*osptr;
     (*osptr)=os;
     os->size=newsize;
     os->top=((char *)ptr)+size;
@@ -208,6 +208,7 @@ int transCommit() {
 #endif
       freenewobjs();
       objstrDelete(t_cache);
+      t_cache=NULL;
       t_chashDelete();
       return TRANS_ABORT;
     }
@@ -220,6 +221,7 @@ int transCommit() {
 #endif
       freenewobjs();
       objstrDelete(t_cache);
+      t_cache=NULL;
       t_chashDelete();
       return 0;
     }