From ca696d378b0d277e466d872a2dbdf712df18d7fd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Milo=C5=A1=20Mula=C4=8D?= Date: Fri, 23 Nov 2007 15:26:42 +0000 Subject: [PATCH] memleaks fixed --- org.glite.lb.common/interface/context-int.h | 1 + org.glite.lb.common/src/xml_conversions.c | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/org.glite.lb.common/interface/context-int.h b/org.glite.lb.common/interface/context-int.h index 8e5a105..bbf69d5 100644 --- a/org.glite.lb.common/interface/context-int.h +++ b/org.glite.lb.common/interface/context-int.h @@ -41,6 +41,7 @@ glite_lb_padded_struct(_edg_wll_ConnProxy,12, typedef struct _edg_wll_ConnProxy edg_wll_ConnProxy; +/* !!! if adding something malloc-able, update edg_wll_FreeContext too !!! */ glite_lb_padded_struct(_edg_wll_Context,120, /* Error handling */ int errCode; /* recent error code */ diff --git a/org.glite.lb.common/src/xml_conversions.c b/org.glite.lb.common/src/xml_conversions.c index 32fab9e..138ccaf 100644 --- a/org.glite.lb.common/src/xml_conversions.c +++ b/org.glite.lb.common/src/xml_conversions.c @@ -370,12 +370,16 @@ void edg_wll_add_intlist_to_XMLBody(char **body, const int *toAdd, const char *t char **list = NULL; int i, len, tot_len = 0; int *len_list = NULL; + char *tag = NULL; i = from; while (i <= to) { + tag = indexToTag(i-1); len = trio_asprintf(&pomA,"%s\t<%s>%|Xd\r\n", - indent, indexToTag(i-1),toAdd[i],indexToTag(i-1)); + indent,tag,toAdd[i],tag); + + if (tag) free(tag); i++; tot_len += len; @@ -473,12 +477,16 @@ void edg_wll_add_time_t_list_to_XMLBody(char **body, const time_t *toAdd, const char **list = NULL; int i, len, tot_len = 0; int *len_list = NULL; + char *tag = NULL; i = from; while (i < to) { + tag = indexToTag(i); len = trio_asprintf(&pomA,"%s\t<%s>%|Xld\r\n", - indent, indexToTag(i),toAdd[i],indexToTag(i)); + indent,tag,toAdd[i],tag); + + if (tag) free(tag); i++; tot_len += len; -- 1.8.2.3