Commit e8a655df authored by Marek Vasut's avatar Marek Vasut

mxssb: Fix possible crash when memory allocation fail

In case the memory allocation fails in the command parser, there
will might remain some allocated memory upon return. Fix this.
Signed-off-by: Marek Vasut's avatarMarek Vasut <marex@denx.de>
parent 443eb3f3
...@@ -624,7 +624,7 @@ static int sb_parse_cmds(struct sb_section_ctx *sctx) ...@@ -624,7 +624,7 @@ static int sb_parse_cmds(struct sb_section_ctx *sctx)
while (insts--) { while (insts--) {
cctx = calloc(1, sizeof(*cctx)); cctx = calloc(1, sizeof(*cctx));
if (!cctx) if (!cctx)
return -ENOMEM; goto err;
if (!head) if (!head)
head = cctx; head = cctx;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment