From 74687b5e942a71f4286121d0d2f0515cc3f3fc16 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Mon, 8 Oct 2012 22:31:47 +0100 Subject: Close off two scan-build warnings as best as I can make out. --- src/core/text.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/text.c b/src/core/text.c index 94718a2..e84972a 100644 --- a/src/core/text.c +++ b/src/core/text.c @@ -473,8 +473,10 @@ dom_exception walk_logic_adjacent_text(dom_text *text, /* Firstly, we look our left */ err = walk_logic_adjacent_text_in_order(left, opt, LEFT, ret, &cont); if (err != DOM_NO_ERR) { - dom_string_unref(*ret); - *ret = NULL; + if (opt == COLLECT) { + dom_string_unref(*ret); + *ret = NULL; + } return err; } @@ -508,8 +510,10 @@ dom_exception walk_logic_adjacent_text(dom_text *text, /* Now, look right */ err = walk_logic_adjacent_text_in_order(right, opt, RIGHT, ret, &cont); if (err != DOM_NO_ERR) { - dom_string_unref(*ret); - *ret = NULL; + if (opt == COLLECT) { + dom_string_unref(*ret); + *ret = NULL; + } return err; } -- cgit v1.2.3