summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2021-03-18 11:39:04 +0100
committerBastien Nocera <hadess@hadess.net>2021-03-18 11:42:11 +0100
commit66f85bac49626778e164600ce3a80bc1ae1b6604 (patch)
treebf5df8bc25fc4f77c3d43c3016aee27b0d64c7a0
parentfa87bbefe00abd45e3dd8fdfcb90672dc3e7e6ee (diff)
downloadshared-mime-info-wip/hadess/misc-fixes.tar.gz
Make programming check more forcefulwip/hadess/misc-fixes
Coverity complains that a g_return_if_fail() that checks on parse_value() respecting its API might leak. Be more forceful, and assert() instead. Can't leak if you crash *taps temple*. shared-mime-info-2.1/src/update-mime-database.c:1482: alloc_arg: "parse_value" allocates memory that is stored into "parsed_mask". shared-mime-info-2.1/src/update-mime-database.c:1488: leaked_storage: Variable "parsed_mask" going out of scope leaks the storage it points to. 1486| { 1487| g_string_free(parsed_value, TRUE); 1488|-> g_return_if_fail(parsed_mask == NULL); 1489| } 1490| else
-rw-r--r--src/update-mime-database.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/update-mime-database.c b/src/update-mime-database.c
index d48e69a9..a8d29673 100644
--- a/src/update-mime-database.c
+++ b/src/update-mime-database.c
@@ -1485,7 +1485,7 @@ static void match_value_and_mask(Match *match, xmlNode *node, GError **error)
if (*error)
{
g_string_free(parsed_value, TRUE);
- g_return_if_fail(parsed_mask == NULL);
+ g_assert(parsed_mask == NULL);
}
else
{