summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2013-11-08 10:35:09 (GMT)
committer Vincent Sanders <vince@netsurf-browser.org>2013-11-08 10:35:09 (GMT)
commita9024ae22b71f72e201448ec3c87e1eff9c644bc (patch)
tree918ec9fdaf5d1d6020163dc0523b8745380f9ced
parent58794d6d364f8fe0ff6cc5ac0e999a6f0bdbc4fd (diff)
downloadlibdom-a9024ae22b71f72e201448ec3c87e1eff9c644bc.tar.gz
libdom-a9024ae22b71f72e201448ec3c87e1eff9c644bc.tar.bz2
fix resource leak of lname in _dom_namespace_validate_qname() (coverity 1127083)
-rw-r--r--src/utils/namespace.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/utils/namespace.c b/src/utils/namespace.c
index 2bc6318..584aeae 100644
--- a/src/utils/namespace.c
+++ b/src/utils/namespace.c
@@ -196,10 +196,12 @@ dom_exception _dom_namespace_validate_qname(dom_string *qname,
return err;
}
- if (_dom_validate_ncname(prefix) == false ||
- _dom_validate_ncname(lname) == false) {
+ if ((_dom_validate_ncname(prefix) == false) ||
+ (_dom_validate_ncname(lname) == false)) {
+ dom_string_unref(lname);
return DOM_NAMESPACE_ERR;
}
+ dom_string_unref(lname);
/* Test for invalid XML namespace */
if (dom_string_isequal(prefix, xml) &&