summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-03-16 17:27:38 +0100
committerPablo Barciela <[email protected]>2019-03-25 21:09:11 +0100
commitcf00858fef7b447e250371588359b72fa535733e (patch)
tree6d3d8e5062351b3ffc0c401265230c13d30523d1
parentc9f41754796048e010e93db118429854e5464bad (diff)
downloadmate-desktop-cf00858fef7b447e250371588359b72fa535733e.tar.bz2
mate-desktop-cf00858fef7b447e250371588359b72fa535733e.tar.xz
mate-bg: Fix memory leak
Fixes Clang static analyzer warning: mate-bg.c:2764:2: warning: Potential leak of memory pointed to by 'size' g_queue_push_tail (parser->stack, g_strdup (name)); ^~~~~~~~~~~~~~~~~
-rw-r--r--libmate-desktop/mate-bg.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c
index 6465879..bdc93ee 100644
--- a/libmate-desktop/mate-bg.c
+++ b/libmate-desktop/mate-bg.c
@@ -2760,6 +2760,8 @@ handle_start_element (GMarkupParseContext *context,
strcmp (parser->stack->tail->data, "to") == 0) {
slide->file2 = g_slist_prepend (slide->file2, size);
}
+ else
+ g_free (size);
}
g_queue_push_tail (parser->stack, g_strdup (name));
}