git » libfiu » commit 06575e3

libfiu: Fix realloc() size miscalculation

author Alberto Bertogli
2009-07-03 06:38:17 UTC
committer Alberto Bertogli
2009-07-03 06:38:17 UTC
parent d7934a2e8c0e35df9b0fccc47bffe65dca015dc6

libfiu: Fix realloc() size miscalculation

Signed-off-by: Alberto Bertogli <albertito@blitiri.com.ar>

libfiu/fiu.c +1 -1

diff --git a/libfiu/fiu.c b/libfiu/fiu.c
index 5c3218d..2a01c91 100644
--- a/libfiu/fiu.c
+++ b/libfiu/fiu.c
@@ -396,7 +396,7 @@ static int insert_new_fail(const char *name, int failnum, void *failinfo,
 
 	/* There are no free slots in enabled_fails, so we must grow it */
 	enabled_fails = realloc(enabled_fails,
-			enabled_fails_len + EF_GROW * sizeof(struct pf_info));
+			(enabled_fails_len + EF_GROW) * sizeof(struct pf_info));
 	if (enabled_fails == NULL) {
 		enabled_fails_last = NULL;
 		enabled_fails_len = 0;