aboutsummaryrefslogtreecommitdiffstats
path: root/extension
diff options
context:
space:
mode:
Diffstat (limited to 'extension')
-rw-r--r--extension/ChangeLog5
-rw-r--r--extension/filefuncs.c7
2 files changed, 12 insertions, 0 deletions
diff --git a/extension/ChangeLog b/extension/ChangeLog
index df493227..a3526863 100644
--- a/extension/ChangeLog
+++ b/extension/ChangeLog
@@ -1,5 +1,10 @@
2012-05-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
+ * filefuncs.c (array_set): Add a comment discussing the use of unref
+ on the value returned by assoc_lookup.
+
+2012-05-13 Andrew J. Schorr <aschorr@telemetry-investments.com>
+
* xreadlink.[ch]: Remove unused files.
2012-05-11 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/extension/filefuncs.c b/extension/filefuncs.c
index 9758ba8e..01f3fce2 100644
--- a/extension/filefuncs.c
+++ b/extension/filefuncs.c
@@ -220,6 +220,13 @@ array_set(NODE *array, const char *sub, NODE *value)
tmp = make_string(sub, strlen(sub));
aptr = assoc_lookup(array, tmp);
unref(tmp);
+ /*
+ * Note: since we initialized with assoc_clear, we know that aptr
+ * has been initialized with Nnull_string. Thus, the call to
+ * unref(*aptr) is not strictly necessary. However, I think it is
+ * generally more correct to call unref to maintain the proper
+ * reference count.
+ */
unref(*aptr);
*aptr = value;
}