aboutsummaryrefslogtreecommitdiff
path: root/tools/rkcommon.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/rkcommon.c')
-rw-r--r--tools/rkcommon.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/rkcommon.c b/tools/rkcommon.c
index fd95abc79ae..a583c0caa0d 100644
--- a/tools/rkcommon.c
+++ b/tools/rkcommon.c
@@ -380,8 +380,9 @@ int rkcommon_vrec_header(struct image_tool_params *params,
/* Allocate, clear and install the header */
tparams->hdr = malloc(tparams->header_size);
+ if (!tparams->hdr)
+ return -ENOMEM;
memset(tparams->hdr, 0, tparams->header_size);
- tparams->header_size = tparams->header_size;
/*
* If someone passed in 0 for the alignment, we'd better handle