From af7d1f5fc489b360668c84e071a2cc034f894468 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Sun, 10 Aug 2008 23:08:50 +0200 Subject: Remove unwanted free, should fix a memory corruption Signed-off-by: Matt Colyer --- src/plist.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src') diff --git a/src/plist.c b/src/plist.c index eed2d48..4d4fce4 100644 --- a/src/plist.c +++ b/src/plist.c @@ -29,7 +29,7 @@ const char *plist_base = "\n\ \n\ \0"; -char* format_string(char* buf, int cols, int depth) +char* format_string(const char* buf, int cols, int depth) { int colw = depth + cols + 1; //new buf cols width int len = strlen(buf); @@ -48,7 +48,6 @@ char* format_string(char* buf, int cols, int depth) for (j = 0; j < depth; j++) new_buf[len+(1+depth)*nlines + 1 + j] = '\t'; new_buf[len+(1+depth)*nlines+depth+1] = '\0'; - free(buf); return new_buf; } -- cgit v1.1-32-gdbae