summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2013-11-08 09:21:40 (GMT)
committer Vincent Sanders <vince@netsurf-browser.org>2013-11-08 09:21:40 (GMT)
commit58794d6d364f8fe0ff6cc5ac0e999a6f0bdbc4fd (patch)
tree10146863ec2e39c02d1cdb4dc325c9b15ef5f550
parentc7ae36d32805b65a0318e89905261c587751e053 (diff)
downloadlibdom-58794d6d364f8fe0ff6cc5ac0e999a6f0bdbc4fd.tar.gz
libdom-58794d6d364f8fe0ff6cc5ac0e999a6f0bdbc4fd.tar.bz2
fix error handling in walk_logic_adjacent_text() (coverity 1127084)
-rw-r--r--src/core/text.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/text.c b/src/core/text.c
index 0bf6322..e36050e 100644
--- a/src/core/text.c
+++ b/src/core/text.c
@@ -486,19 +486,18 @@ dom_exception walk_logic_adjacent_text(dom_text *text,
if (opt == COLLECT) {
dom_string *data = NULL, *tmp = NULL;
err = dom_characterdata_get_data(text, &data);
- if (err == DOM_NO_ERR) {
+ if (err != DOM_NO_ERR) {
dom_string_unref(*ret);
return err;
}
err = dom_string_concat(*ret, data, &tmp);
- if (err == DOM_NO_ERR) {
- dom_string_unref(*ret);
+ dom_string_unref(data);
+ dom_string_unref(*ret);
+ if (err != DOM_NO_ERR) {
return err;
}
- dom_string_unref(*ret);
- dom_string_unref(data);
*ret = tmp;
} else {
dom_node_internal *tn;