]> git.draconx.ca Git - cdecl99.git/commitdiff
Fix error handling in explain.
authorNick Bowler <nbowler@draconx.ca>
Mon, 4 Jul 2011 22:10:30 +0000 (18:10 -0400)
committerNick Bowler <nbowler@draconx.ca>
Mon, 4 Jul 2011 22:10:30 +0000 (18:10 -0400)
On a memory allocation failure, we leak the decl allocated by the
parser.  Fix that up.

src/cdecl99.c

index a0771912fe24acb404fe0df5790763be0d0b4a6c..28bd23bc20935f98c6b78159fa17b97a3b1ecc5c 100644 (file)
@@ -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;