memleak fixed
authorMiloš Mulač <mulac@civ.zcu.cz>
Thu, 15 Nov 2007 14:34:04 +0000 (14:34 +0000)
committerMiloš Mulač <mulac@civ.zcu.cz>
Thu, 15 Nov 2007 14:34:04 +0000 (14:34 +0000)
org.glite.lb.server/src/jobstat_supp.c

index 9be51f1..f5cb84a 100644 (file)
@@ -219,15 +219,18 @@ static char **dec_strlist(char *in, char **rest)
                return NULL;
        }
 
+       /* count number of fields only */
        len = 0;
        tmp_in = in = strchr(in, ' ') + 1 ;
        do {
                tmp_ret = dec_string(tmp_in, &tmp_in);
+               free(tmp_ret); 
                len++;
        }  while (tmp_ret != NULL);
 
        out = (char**) malloc(len*sizeof(char*));
 
+       /* get them */
        if (out) {
                len = 0;
                tmp_in = in;