diff options
author | Nick White <hg@njw.me.uk> | 2011-07-17 14:41:22 +0100 |
---|---|---|
committer | Nick White <hg@njw.me.uk> | 2011-07-17 14:41:22 +0100 |
commit | 75c05e825809a3011df800398e169749404b9be9 (patch) | |
tree | 7c228d8cc516d8aaa6dd1ff55f7029f8453d5cf0 | |
parent | 8833643928f69df99ae3394a53aa2855f7a02000 (diff) |
Remove bad free bug
-rw-r--r-- | getgbook.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -72,9 +72,8 @@ Page *getpagedetail(char *bookid, char *pg) return NULL; snprintf(m, 80, "\"pid\":\"%s\"", pg); - if((c = strstr(buf,m)) == NULL) { - free(buf); return NULL; - } + if((c = strstr(buf,m)) == NULL) + return NULL; page = malloc(sizeof(Page)); strncpy(page->name, pg, 80); |