summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christophe Fergeau2008-08-10 23:08:50 +0200
committerGravatar Matt Colyer2008-08-11 09:35:59 -0700
commitaf7d1f5fc489b360668c84e071a2cc034f894468 (patch)
treefa18af26f8f25de2281b623a1c1c8f617c4509cb
parent1e304d42f0884c5ea3162e34ce27eba11c1e74f0 (diff)
downloadlibimobiledevice-af7d1f5fc489b360668c84e071a2cc034f894468.tar.gz
libimobiledevice-af7d1f5fc489b360668c84e071a2cc034f894468.tar.bz2
Remove unwanted free, should fix a memory corruption
Signed-off-by: Matt Colyer <matt@colyer.name>
-rw-r--r--src/plist.c3
1 files changed, 1 insertions, 2 deletions
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 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n\
<plist version=\"1.0\">\n\
</plist>\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;
}