summaryrefslogtreecommitdiff
path: root/getgbook.c
diff options
context:
space:
mode:
authorNick White <git@njw.me.uk>2011-08-18 23:37:25 +0100
committerNick White <git@njw.me.uk>2011-08-18 23:37:25 +0100
commit496e3d7171044a381b91a9a077e7ecc53cd19f97 (patch)
tree8f3b4c56665fb7eb31191ec567ebb245d2dee819 /getgbook.c
parentfd9b2a8213fcd98cba454ef8c3b71ad3b806cc12 (diff)
Fix memory allocation bugs
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 a9c0165..29f7a19 100644
--- a/getgbook.c
+++ b/getgbook.c
@@ -140,8 +140,8 @@ int main(int argc, char *argv[])
*/
Page **page;
- page = malloc(sizeof(Page) * 1000);
- for(i=0; i<1000; i++) page[i] = malloc(sizeof(*page));
+ page = malloc(sizeof(*page) * 1000);
+ for(i=0; i<1000; i++) page[i] = malloc(sizeof(**page));
if(!(i = getpagelist(bookid, page))) {
fprintf(stderr, "Could not find pages for %s\n", bookid);
return 1;