flashmap: Allocate at least one entry in kv_pair_new()

Change-Id: I971fa85ed977884d050790560a5a8f2ce955eb7c
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/14444
Tested-by: build bot (Jenkins)
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
Stefan Reinauer 2016-04-20 22:13:37 -07:00 committed by Patrick Georgi
parent 3d609325b9
commit 1bf00079c1
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ struct kv_pair *kv_pair_new(void)
{ {
struct kv_pair *kv; struct kv_pair *kv;
kv = calloc(0, sizeof(*kv)); kv = calloc(1, sizeof(*kv));
if (!kv) if (!kv)
return NULL; return NULL;