memleaks fixed
authorMiloš Mulač <mulac@civ.zcu.cz>
Fri, 23 Nov 2007 15:26:42 +0000 (15:26 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Fri, 23 Nov 2007 15:26:42 +0000 (15:26 +0000)
org.glite.lb.common/interface/context-int.h
org.glite.lb.common/src/xml_conversions.c

index 8e5a105..bbf69d5 100644 (file)
@@ -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 */
index 32fab9e..138ccaf 100644 (file)
@@ -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</%s>\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</%s>\r\n",
-                        indent, indexToTag(i),toAdd[i],indexToTag(i));
+                        indent,tag,toAdd[i],tag);
+
+               if (tag) free(tag);
 
                i++;
                 tot_len += len;