From 3e91fcb8966521a455d51395d49d98eb2ed83603 Mon Sep 17 00:00:00 2001 From: bdemsky Date: Mon, 19 Nov 2007 21:51:00 +0000 Subject: [PATCH] memory leak --- Robust/src/Runtime/task.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Robust/src/Runtime/task.c b/Robust/src/Runtime/task.c index 96b78d8c..788ee676 100644 --- a/Robust/src/Runtime/task.c +++ b/Robust/src/Runtime/task.c @@ -367,9 +367,12 @@ void flagbody(struct ___Object___ *ptr, int flag) { /*Remove object from all queues */ while(flagptr!=NULL) { struct parameterwrapper *next; - int UNUSED, UNUSED2, UNUSED3; - ObjectHashget(flagptr->objectset, (int) ptr, (int *) &next, &UNUSED, &UNUSED2, &UNUSED3); + int UNUSED, UNUSED2; + int * enterflags; + ObjectHashget(flagptr->objectset, (int) ptr, (int *) &next, (int *) &enterflags, &UNUSED, &UNUSED2); ObjectHashremove(flagptr->objectset, (int)ptr); + if (enterflags!=NULL) + free(enterflags); flagptr=next; } @@ -803,9 +806,12 @@ void enqueueoptional(struct ___Object___ * currobj, int numfailedfses, int * fai /*Remove object from all queues */ while(flagptr!=NULL) { struct parameterwrapper *next; - int UNUSED, UNUSED2, UNUSED3; - ObjectHashget(flagptr->objectset, (int) currobj, (int *) &next, &UNUSED, &UNUSED2, &UNUSED3); + int UNUSED, UNUSED2; + int * enterflags; + ObjectHashget(flagptr->objectset, (int) currobj, (int *) &next, (int *) &enterflags, &UNUSED, &UNUSED2); ObjectHashremove(flagptr->objectset, (int)currobj); + if (enterflags!=NULL) + free(enterflags); flagptr=next; } -- 2.34.1