From 1ad0c3e4cc7c41f7aa1a6a64b4f465d189c478c7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ji=C5=99=C3=AD=20Filipovi=C4=8D?= Date: Tue, 3 Jun 2008 10:54:49 +0000 Subject: [PATCH] Memory leaks removed. --- org.glite.lb.state-machine/src/lb_plugin.c | 3 +++ org.glite.lb.state-machine/src/process_event_pbs.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/org.glite.lb.state-machine/src/lb_plugin.c b/org.glite.lb.state-machine/src/lb_plugin.c index 833085f..fc5884b 100644 --- a/org.glite.lb.state-machine/src/lb_plugin.c +++ b/org.glite.lb.state-machine/src/lb_plugin.c @@ -308,6 +308,7 @@ static int lb_close(void *fpctx,void *handle) { free (h->fullStatusHistory[i]); i++; } + free(h->fullStatusHistory); h->fullStatusHistory = NULL; h->lastStatusHistory = NULL; h->finalStatus = NULL; @@ -1677,11 +1678,13 @@ static int lb_status(void *handle) { // not very clean, but working memset(&js->pub, 0, sizeof(edg_wll_JobStat)); destroy_intJobStat(js); + free(js); return 0; err: destroy_intJobStat(js); + free(js); return -1; } diff --git a/org.glite.lb.state-machine/src/process_event_pbs.c b/org.glite.lb.state-machine/src/process_event_pbs.c index 9389c2f..64992ef 100644 --- a/org.glite.lb.state-machine/src/process_event_pbs.c +++ b/org.glite.lb.state-machine/src/process_event_pbs.c @@ -210,13 +210,13 @@ int processEvent_PBS(intJobStat *js, edg_wll_Event *e, int ev_seq, int strict, c /* XXX : just debug output - remove */ - printf("processEvent_PBS(): %s (%s), state: %s --> %s\n ", + /*printf("processEvent_PBS(): %s (%s), state: %s --> %s\n ", edg_wll_EventToString(e->any.type), (res == RET_LATE) ? "RET_LATE" : "RET_OK", edg_wll_StatToString(old_state), edg_wll_StatToString(js->pub.state) ); printf("\t%s\n",e->any.seqcode); - printf("\t(last=%s)\n",js->last_seqcode); + printf("\t(last=%s)\n",js->last_seqcode);*/ /*----------------------------------*/ -- 1.8.2.3