From 8209a7efe3908f6935c5cd78f2099bdeb802e784 Mon Sep 17 00:00:00 2001 From: Yorhel <git@yorhel.nl> Date: Tue, 5 May 2009 19:33:30 +0200 Subject: [PATCH] Allocate correct amount of memory for the links list I happen to make these kinds of mistakes a lot, for some strange reason. Maybe I should just get more sleep... --- src/calc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/calc.c b/src/calc.c index f9c6064..0c05a05 100644 --- a/src/calc.c +++ b/src/calc.c @@ -152,9 +152,9 @@ int calc_item(struct dir *par, char *name) { linksl *= 2; if(!linksl) { linksl = 64; - links = malloc(linksl); + links = malloc(linksl*sizeof(struct link_inode)); } else - links = realloc(links, linksl); + links = realloc(links, linksl*sizeof(struct link_inode)); } links[i].dev = fs.st_dev; links[i].ino = fs.st_ino; -- GitLab