diff options
-rwxr-xr-x | ChangeLog | 5 | ||||
-rw-r--r-- | builtin.c | 6 |
2 files changed, 11 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2019-01-14 Andrew J. Schorr <aschorr@telemetry-investments.com> + + * builtin.c (do_typeof): Fix memory leak when populating the + optional array, and make sure to call the astore method. + 2019-01-09 Andrew J. Schorr <aschorr@telemetry-investments.com> * awkgram.y (tokentab): Indicate that typeof may take 2 arguments. @@ -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: |