summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2013-11-08 10:37:08 (GMT)
committer Vincent Sanders <vince@netsurf-browser.org>2013-11-08 10:37:08 (GMT)
commitc00dc3f954d5fc7a9305de2bb5bf01fa894863eb (patch)
tree94c6466dc1b351e35fd6cb0e0baa6297f3760fb2
parenta9024ae22b71f72e201448ec3c87e1eff9c644bc (diff)
downloadlibdom-c00dc3f954d5fc7a9305de2bb5bf01fa894863eb.tar.gz
libdom-c00dc3f954d5fc7a9305de2bb5bf01fa894863eb.tar.bz2
fix resource leak in error path (coverity 1127082)
-rw-r--r--src/utils/namespace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/utils/namespace.c b/src/utils/namespace.c
index 584aeae..c18e24b 100644
--- a/src/utils/namespace.c
+++ b/src/utils/namespace.c
@@ -193,11 +193,13 @@ dom_exception _dom_namespace_validate_qname(dom_string *qname,
err = dom_string_substr(qname, colon + 1, len, &lname);
if (err != DOM_NO_ERR) {
+ dom_string_unref(prefix);
return err;
}
if ((_dom_validate_ncname(prefix) == false) ||
(_dom_validate_ncname(lname) == false)) {
+ dom_string_unref(prefix);
dom_string_unref(lname);
return DOM_NAMESPACE_ERR;
}