From: Michal Voců Date: Thu, 26 Jan 2012 14:08:31 +0000 (+0000) Subject: fix memory allocation X-Git-Tag: merge_torque_to_head_src~1 X-Git-Url: http://scientific.zcu.cz/git/?a=commitdiff_plain;h=030b83f16c0b0eaf06d2bb4ba1b61abde265e7c0;p=jra1mw.git fix memory allocation --- diff --git a/org.glite.lb.common/src/events_parse.c.T b/org.glite.lb.common/src/events_parse.c.T index 93dea0f..78c7adb 100644 --- a/org.glite.lb.common/src/events_parse.c.T +++ b/org.glite.lb.common/src/events_parse.c.T @@ -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';