diff options
author | Nick White <git@njw.me.uk> | 2011-08-18 23:08:25 +0100 |
---|---|---|
committer | Nick White <git@njw.me.uk> | 2011-08-18 23:08:25 +0100 |
commit | 2c612c00078c73297ad778ea21ffaf13ec058e81 (patch) | |
tree | 7a349bee2b2e9601a071c4141a8a284e9d639fa9 | |
parent | 3afe70f3cd0a19465ef9f8bbaf6a0961d9eb6d3a (diff) |
Fix cookie bug causing segfault if site blocked
-rw-r--r-- | getgbook.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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]; |