summaryrefslogtreecommitdiff
path: root/capplets/common/mate-theme-info.c
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-10-22 14:44:46 +0200
committerLuke from DC <[email protected]>2022-02-09 04:18:44 +0000
commitf55958b8fa846389d30fb4c4a53855949831c590 (patch)
tree46c0de4a4d087147b02bce9126f5780f153d0b3f /capplets/common/mate-theme-info.c
parentadb7473aa58143cfcba554e3d8d35943f850f362 (diff)
downloadmate-control-center-f55958b8fa846389d30fb4c4a53855949831c590.tar.bz2
mate-control-center-f55958b8fa846389d30fb4c4a53855949831c590.tar.xz
common: fix memory leak detected by scan-build
Diffstat (limited to 'capplets/common/mate-theme-info.c')
-rw-r--r--capplets/common/mate-theme-info.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/capplets/common/mate-theme-info.c b/capplets/common/mate-theme-info.c
index 1294b7d2..ea9a6635 100644
--- a/capplets/common/mate-theme-info.c
+++ b/capplets/common/mate-theme-info.c
@@ -1213,11 +1213,14 @@ real_add_top_theme_dir_monitor (GFile *uri,
tuple->priority = priority;
/* Monitor the top directory */
- monitor = g_file_monitor_directory (uri, G_FILE_MONITOR_NONE, NULL, NULL);
- if (monitor != NULL) {
+ if ((monitor = g_file_monitor_directory (uri, G_FILE_MONITOR_NONE, NULL, NULL)) != NULL) {
g_signal_connect (monitor, "changed",
(GCallback) (icon_theme ? top_icon_theme_dir_changed : top_theme_dir_changed),
tuple);
+ } else {
+ g_hash_table_destroy (tuple->handle_hash);
+ g_free (tuple);
+ return FALSE;
}
/* Go through the directory to add monitoring */