aboutsummaryrefslogtreecommitdiffstats
path: root/interpret.h
diff options
context:
space:
mode:
authorjohn haque <j.eh@mchsi.com>2012-04-17 13:29:32 -0500
committerjohn haque <j.eh@mchsi.com>2012-04-17 13:29:32 -0500
commit07e08a881ae177d3e3b7cfd2c5199443c6db3dd0 (patch)
tree39ba7b6a731f6f24f1ba0d797d52cc7706ed8ac1 /interpret.h
parentb1062311a3caab9ec89c0f104bd9b4334174f23c (diff)
downloadegawk-07e08a881ae177d3e3b7cfd2c5199443c6db3dd0.tar.gz
egawk-07e08a881ae177d3e3b7cfd2c5199443c6db3dd0.tar.bz2
egawk-07e08a881ae177d3e3b7cfd2c5199443c6db3dd0.zip
Use unref when freeing a null array element.
Diffstat (limited to 'interpret.h')
-rw-r--r--interpret.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/interpret.h b/interpret.h
index 009e6e10..83b908cc 100644
--- a/interpret.h
+++ b/interpret.h
@@ -224,7 +224,9 @@ top:
if (r == NULL) {
r = make_array();
r->parent_array = t1;
- *assoc_lookup(t1, t2) = r;
+ lhs = assoc_lookup(t1, t2);
+ unref(*lhs);
+ *lhs = r;
t2 = force_string(t2);
r->vname = estrdup(t2->stptr, t2->stlen); /* the subscript in parent array */
} else if (r->type != Node_var_array) {