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:
parent
3d609325b9
commit
1bf00079c1
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue