From 1bf00079c15c7afff5f82dd0f84e4372ef3c77b2 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Wed, 20 Apr 2016 22:13:37 -0700 Subject: flashmap: Allocate at least one entry in kv_pair_new() Change-Id: I971fa85ed977884d050790560a5a8f2ce955eb7c Signed-off-by: Stefan Reinauer Reviewed-on: https://review.coreboot.org/14444 Tested-by: build bot (Jenkins) Reviewed-by: Patrick Georgi --- util/cbfstool/flashmap/kv_pair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/cbfstool/flashmap') diff --git a/util/cbfstool/flashmap/kv_pair.c b/util/cbfstool/flashmap/kv_pair.c index 95e5034e95..c02068c1c2 100644 --- a/util/cbfstool/flashmap/kv_pair.c +++ b/util/cbfstool/flashmap/kv_pair.c @@ -56,7 +56,7 @@ struct kv_pair *kv_pair_new(void) { struct kv_pair *kv; - kv = calloc(0, sizeof(*kv)); + kv = calloc(1, sizeof(*kv)); if (!kv) return NULL; -- cgit v1.2.3