From b74485ec6ca3e604d6d88457b2e3b30c546a43b9 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Thu, 9 Apr 2009 06:58:34 +0000 Subject: [PATCH] fix memory leak --- Robust/src/Runtime/STM/stm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Robust/src/Runtime/STM/stm.c b/Robust/src/Runtime/STM/stm.c index 1c6af83b..6cf89a74 100644 --- a/Robust/src/Runtime/STM/stm.c +++ b/Robust/src/Runtime/STM/stm.c @@ -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; } -- 2.34.1