From: Nick Bowler Date: Mon, 4 Jul 2011 22:10:30 +0000 (-0400) Subject: Fix error handling in explain. X-Git-Tag: v1~160 X-Git-Url: https://git.draconx.ca/gitweb/cdecl99.git/commitdiff_plain/84bb886e4cfa6a74a9fe5081a91461ef0a19d0ab Fix error handling in explain. On a memory allocation failure, we leak the decl allocated by the parser. Fix that up. --- diff --git a/src/cdecl99.c b/src/cdecl99.c index a077191..28bd23b 100644 --- a/src/cdecl99.c +++ b/src/cdecl99.c @@ -54,7 +54,7 @@ retry: tmp = realloc(buf, rc + 1); if (!tmp) { fprintf(stderr, "failed to allocate memory\n"); - return 1; + goto out; } buf = tmp;