summaryrefslogtreecommitdiff
path: root/capplets
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-10-22 14:44:46 +0200
committerraveit65 <[email protected]>2023-05-07 17:10:47 +0200
commitdde64d88b7463d4f47ffcae317765c24b2bd708f (patch)
tree75c4bfe4cc22ff9ed2937fadb3781f9fe4bdb416 /capplets
parentb90fe28e2c04043a819384ca408c6963f227381a (diff)
downloadmate-control-center-dde64d88b7463d4f47ffcae317765c24b2bd708f.tar.bz2
mate-control-center-dde64d88b7463d4f47ffcae317765c24b2bd708f.tar.xz
common: fix memory leak detected by scan-build
Diffstat (limited to 'capplets')
-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 6971602e..c8eca7f0 100644
--- a/capplets/common/mate-theme-info.c
+++ b/capplets/common/mate-theme-info.c
@@ -1215,11 +1215,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 */