fix memory allocation
authorMichal Voců <michal@ruk.cuni.cz>
Thu, 26 Jan 2012 14:08:31 +0000 (14:08 +0000)
committerMichal Voců <michal@ruk.cuni.cz>
Thu, 26 Jan 2012 14:08:31 +0000 (14:08 +0000)
org.glite.lb.common/src/events_parse.c.T

index 93dea0f..78c7adb 100644 (file)
@@ -88,10 +88,10 @@ char * edg_wll_TagListToString(edg_wll_TagValue *list) {
        for(tag = list; tag->tag; tag++) {
                len += strlen(tag->tag);
                len += strlen(tag->value);
-               len++;
+               len += 2;
        }
        
-       out = malloc(len*sizeof(char));
+       out = malloc(len*sizeof(char) + 1);
        if(NULL == out) return NULL;
 
        *out = '\0';