diff options
author | Přemysl Janouch <p.janouch@gmail.com> | 2017-05-21 00:24:47 +0200 |
---|---|---|
committer | Přemysl Janouch <p.janouch@gmail.com> | 2017-05-21 13:19:47 +0200 |
commit | 4d15d9cc6b7035fe5d5bfa390c2d6e6c24b51914 (patch) | |
tree | d48486859a06150438408ae4b25bf1d58a936c77 | |
parent | cbce0d649816cb782f2d2932e8aa74edfda64da1 (diff) | |
download | ell-4d15d9cc6b7035fe5d5bfa390c2d6e6c24b51914.tar.gz ell-4d15d9cc6b7035fe5d5bfa390c2d6e6c24b51914.tar.xz ell-4d15d9cc6b7035fe5d5bfa390c2d6e6c24b51914.zip |
Fix invalid memory access in debug code
-rwxr-xr-x | ell.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -1116,17 +1116,16 @@ main (int argc, char *argv[]) { parser_init (&parser, buf.s, buf.len - 1); const char *e = NULL; struct item *program = parser_run (&parser, &e); - free (buf.s); - if (e) { - printf ("%s: %s\n", "parse error", e); - return 1; - } - #ifndef NDEBUG printf ("\x1b[1m%s\x1b[0m\n", buf.s); print_tree (program, 0); printf ("\n\n"); #endif + free (buf.s); + if (e) { + printf ("%s: %s\n", "parse error", e); + return 1; + } parser_free (&parser); struct context ctx; |