summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn-Mark Bell <jmb@netsurf-browser.org>2012-12-31 00:10:00 (GMT)
committer John-Mark Bell <jmb@netsurf-browser.org>2012-12-31 00:10:00 (GMT)
commit7e8a1f4f60bd8189f097517b04d3f0a81f36324a (patch)
tree2df0ee7a4f7f048eb0d8766dd138f84454f4b307
parent9508d0205519b6f4bc7901d5cfe260d9860bca87 (diff)
downloadlibdom-7e8a1f4f60bd8189f097517b04d3f0a81f36324a.tar.gz
libdom-7e8a1f4f60bd8189f097517b04d3f0a81f36324a.tar.bz2
Fix reference leak in error case.
-rw-r--r--src/core/characterdata.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/characterdata.c b/src/core/characterdata.c
index c46a5c6..94c286e 100644
--- a/src/core/characterdata.c
+++ b/src/core/characterdata.c
@@ -247,8 +247,10 @@ dom_exception _dom_characterdata_append_data(struct dom_characterdata *cdata,
doc = dom_node_get_owner(cdata);
err = _dom_dispatch_characterdata_modified_event(doc, c, c->value,
temp, &success);
- if (err != DOM_NO_ERR)
+ if (err != DOM_NO_ERR) {
+ dom_string_unref(temp);
return err;
+ }
if (c->value != NULL) {
dom_string_unref(c->value);