summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-03-16 17:27:38 +0100
committerZenWalker <[email protected]>2019-03-25 21:06:11 +0100
commit1fa41d259b1f37b4ca4ec64cf10d70c6da364850 (patch)
treecac1b443c51010869ec62ee557913a36d42abbaf
parentc4c06da6d15acc4d0e19df2b97a9f6637dab9171 (diff)
downloadmate-desktop-1fa41d259b1f37b4ca4ec64cf10d70c6da364850.tar.bz2
mate-desktop-1fa41d259b1f37b4ca4ec64cf10d70c6da364850.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));
}