From 99e184df5e808dd4de24b3e41c724bf9b00b9bb4 Mon Sep 17 00:00:00 2001 From: "Andrew J. Schorr" Date: Mon, 14 Jan 2019 09:56:14 -0500 Subject: Fix memory leak in new do_typeof optional array arg. --- builtin.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'builtin.c') diff --git a/builtin.c b/builtin.c index c92a5982..9cf817ac 100644 --- a/builtin.c +++ b/builtin.c @@ -4090,6 +4090,9 @@ do_typeof(int nargs) NODE **lhs = assoc_lookup(dbg, sub); unref(*lhs); *lhs = make_string(arg->array_funcs->name, strlen(arg->array_funcs->name)); + if (dbg->astore != NULL) + (*dbg->astore)(dbg, sub); + unref(sub); } break; case Node_val: @@ -4125,6 +4128,9 @@ do_typeof(int nargs) NODE **lhs = assoc_lookup(dbg, sub); unref(*lhs); *lhs = make_string(s, strlen(s)); + if (dbg->astore != NULL) + (*dbg->astore)(dbg, sub); + unref(sub); } break; case Node_var_new: -- cgit v1.2.3