From 75c05e825809a3011df800398e169749404b9be9 Mon Sep 17 00:00:00 2001 From: Nick White Date: Sun, 17 Jul 2011 14:41:22 +0100 Subject: Remove bad free bug --- getgbook.c | 5 ++--- 1 file 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); -- cgit v1.2.3