From b4a06c1ae0925d90aa15e16f5df4839ace7e9d26 Mon Sep 17 00:00:00 2001 From: Nick White Date: Fri, 23 Sep 2011 19:38:36 +0100 Subject: Make free usage in getabook more sensible --- getabook.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/getabook.c b/getabook.c index 9f10868..03552a7 100644 --- a/getabook.c +++ b/getabook.c @@ -28,7 +28,6 @@ int fillurls(char *buf) { int i; if(!(s = strstr(buf, "\"jumboImageUrls\":{"))) { - free(buf); return 1; } s += strlen("\"jumboImageUrls\":{"); @@ -53,7 +52,6 @@ int fillurls(char *buf) { continue; } - free(buf); return 0; } @@ -87,6 +85,7 @@ int getpagelist() fillurls(buf); + free(buf); return 0; } @@ -101,6 +100,7 @@ int getpageurls(int pagenum) { fillurls(buf); + free(buf); return 0; } -- cgit v1.2.3