From 12857707435f1d4bf9adf33b6fbfd57ff91529a7 Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Fri, 9 May 2014 11:42:52 +0300 Subject: Fix memory leak in do_eval. --- debug.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'debug.c') diff --git a/debug.c b/debug.c index 1ff43bd6..32b308af 100644 --- a/debug.c +++ b/debug.c @@ -5448,6 +5448,7 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) int ecount = 0, pcount = 0; int ret; int save_flags = do_flags; + SRCFILE *the_source; if (prog_running) { this_frame = find_frame(0); @@ -5458,7 +5459,7 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) ctxt = new_context(); ctxt->install_func = append_symbol; /* keep track of newly installed globals */ push_context(ctxt); - (void) add_srcfile(SRC_CMDLINE, arg->a_string, srcfiles, NULL, NULL); + the_source = add_srcfile(SRC_CMDLINE, arg->a_string, srcfiles, NULL, NULL); do_flags = false; ret = parse_program(&code); do_flags = save_flags; @@ -5575,6 +5576,8 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) * destroy_symbol(f); // destroy "@eval" */ + free_srcfile(the_source); + return false; } -- cgit v1.2.3