From e8a655df645d5947b629f3b7be4c58d30e3fe14d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Sun, 14 Jul 2013 16:23:07 +0200 Subject: [PATCH] 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 --- mxssb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mxssb.c b/mxssb.c index d00facb..ccbf1c6 100644 --- a/mxssb.c +++ b/mxssb.c @@ -624,7 +624,7 @@ static int sb_parse_cmds(struct sb_section_ctx *sctx) while (insts--) { cctx = calloc(1, sizeof(*cctx)); if (!cctx) - return -ENOMEM; + goto err; if (!head) head = cctx; -- GitLab