From: František Dvořák Date: Fri, 15 Feb 2013 08:16:23 +0000 (+0000) Subject: Memleak in lb.server - locally generated ulm line. X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=54018b9d3b237bf15ee955f20a8c2ac1ec4ce1e2;p=jra1mw.git Memleak in lb.server - locally generated ulm line. --- diff --git a/org.glite.lb.server/src/store.c.T b/org.glite.lb.server/src/store.c.T index 23eb558..789706a 100644 --- a/org.glite.lb.server/src/store.c.T +++ b/org.glite.lb.server/src/store.c.T @@ -451,11 +451,14 @@ static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,char #endif char *stmt; - int err = 0; + int err = 0, local_ulm = 0; assert(ulm || e); edg_wll_ResetError(ctx); - if (!ulm) ulm = edg_wll_UnparseEvent(ctx, e); + if (!ulm) { + ulm = edg_wll_UnparseEvent(ctx, e); + local_ulm = 1; + } if (!ulm) return edg_wll_Error(ctx, NULL, NULL); #ifndef LB_EVENTS_BLOB @@ -527,7 +530,6 @@ static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,char free(stmt); } #else - if (!ulm) ulm = edg_wll_UnparseEvent(ctx, e); trio_asprintf(&stmt, "insert into events_flesh (jobid, event, ulm) values ('%|Ss', %d, '%|Ss')", jobid, no, ulm); glite_common_log_msg(LOG_CATEGORY_LB_SERVER_DB, LOG_PRIORITY_DEBUG, stmt); @@ -535,6 +537,8 @@ static int store_flesh(edg_wll_Context ctx,edg_wll_Event *e,const char *ulm,char free(stmt); #endif + if (local_ulm) free(ulm); + return err; }