summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick White <hg@njw.me.uk>2011-07-17 14:41:22 +0100
committerNick White <hg@njw.me.uk>2011-07-17 14:41:22 +0100
commit75c05e825809a3011df800398e169749404b9be9 (patch)
tree7c228d8cc516d8aaa6dd1ff55f7029f8453d5cf0
parent8833643928f69df99ae3394a53aa2855f7a02000 (diff)
Remove bad free bug
-rw-r--r--getgbook.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/getgbook.c b/getgbook.c
index 22fd646..9fa9ff9 100644
--- a/getgbook.c
+++ b/getgbook.c
@@ -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);