summaryrefslogtreecommitdiff
path: root/getgbook.c
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-08-18 23:08:25 +0100
committerNick White <git@njw.me.uk>2011-08-18 23:08:25 +0100
commit2c612c00078c73297ad778ea21ffaf13ec058e81 (patch)
tree7a349bee2b2e9601a071c4141a8a284e9d639fa9 /getgbook.c
parent3afe70f3cd0a19465ef9f8bbaf6a0961d9eb6d3a (diff)
Fix cookie bug causing segfault if site blocked
Diffstat (limited to 'getgbook.c')
-rw-r--r--getgbook.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/getgbook.c b/getgbook.c
index 52eb82a..f944d9f 100644
--- a/getgbook.c
+++ b/getgbook.c
@@ -89,8 +89,8 @@ int main(int argc, char *argv[])
/* get cookies */
for(i=0;i<COOKIENUM;i++) {
- get("books.google.com", "/", NULL, cookies[i], &tmp);
- free(tmp);
+ if(get("books.google.com", "/", NULL, cookies[i], &tmp))
+ free(tmp);
}
bookid = argv[argc-1];