]> ocean-lang.org Git - ocean/commitdiff
parsergen: some missing 'free' calls.
authorNeilBrown <neil@brown.name>
Fri, 5 Mar 2021 09:14:29 +0000 (20:14 +1100)
committerNeilBrown <neil@brown.name>
Wed, 10 Mar 2021 01:00:30 +0000 (12:00 +1100)
Well... one missing call, and some places were we need to do something a
bit more.

Signed-off-by: NeilBrown <neil@brown.name>
csrc/parsergen.mdc

index 86aa299fff058d07a9e562a21d006f9ccb2c1cf6..f2bbe0151d75977dd2b2ae9f16031f4c171a5949 100644 (file)
@@ -561,6 +561,7 @@ Now we have all the bits we need to parse a full production.
        abort:
                while (tk.num != TK_newline && tk.num != TK_eof)
                        tk = token_next(state);
+               free(p.body);
                return err;
        }
 
@@ -695,7 +696,7 @@ used as a terminal anywhere that a terminal is expected.
                                        s->name.len, s->name.txt);
                        }
                        if (errs) {
-                               free(g);
+                               free(g); // FIXME free content
                                g = NULL;
                        }
                }
@@ -704,7 +705,7 @@ used as a terminal anywhere that a terminal is expected.
                fprintf(stderr, "Error at line %d: %s\n",
                        tk.line, err);
                token_close(state);
-               free(g);
+               free(g); // FIXME free content
                return NULL;
        }