From 030b83f16c0b0eaf06d2bb4ba1b61abde265e7c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michal=20Voc=C5=AF?= Date: Thu, 26 Jan 2012 14:08:31 +0000 Subject: [PATCH] fix memory allocation --- org.glite.lb.common/src/events_parse.c.T | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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'; -- 1.8.2.3