summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Hughes <richard@hughsie.com>2022-04-13 14:16:02 +0100
committerRichard Hughes <richard@hughsie.com>2022-04-13 14:42:28 +0100
commit124efd03f3cb9b1df819134eb7cb6683497be9b1 (patch)
treecc95d38ddc0211d6fa8c1b042e62405e7949bd2a
parentc357ea2e1f65b5127a33960e89163245355a4d7c (diff)
downloadcolord-124efd03f3cb9b1df819134eb7cb6683497be9b1.tar.gz
Fix a double free spotted by Coverity
-rw-r--r--lib/colord/cd-icc-store.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/lib/colord/cd-icc-store.c b/lib/colord/cd-icc-store.c
index 11a2fb4..f626073 100644
--- a/lib/colord/cd-icc-store.c
+++ b/lib/colord/cd-icc-store.c
@@ -408,13 +408,12 @@ cd_icc_store_search_path (CdIccStore *store,
/* check sanity */
if (depth > CD_ICC_STORE_MAX_RECURSION_LEVELS) {
- ret = FALSE;
g_set_error (error,
CD_ICC_ERROR,
CD_ICC_ERROR_FAILED_TO_OPEN,
"cannot recurse more than %i levels deep",
CD_ICC_STORE_MAX_RECURSION_LEVELS);
- goto out;
+ return FALSE;
}
/* add an inotify watch if not already added */
@@ -428,9 +427,8 @@ cd_icc_store_search_path (CdIccStore *store,
NULL,
error);
if (helper->monitor == NULL) {
- ret = FALSE;
cd_icc_store_helper_free (helper);
- goto out;
+ return FALSE;
}
g_signal_connect (helper->monitor, "changed",
G_CALLBACK(cd_icc_store_file_monitor_changed_cb),
@@ -447,11 +445,10 @@ cd_icc_store_search_path (CdIccStore *store,
cancellable,
error);
if (enumerator == NULL) {
- ret = FALSE;
helper = cd_icc_store_find_by_directory (store, path);
if (helper != NULL)
g_ptr_array_remove (priv->directory_array, helper);
- goto out;
+ return FALSE;
}
/* get all the files */
@@ -460,9 +457,8 @@ cd_icc_store_search_path (CdIccStore *store,
cancellable,
&error_local);
if (info == NULL && error_local != NULL) {
- ret = FALSE;
g_propagate_error (error, error_local);
- goto out;
+ return FALSE;
}
/* special value, meaning "no more files to process" */
@@ -476,12 +472,10 @@ cd_icc_store_search_path (CdIccStore *store,
depth,
cancellable,
error);
- g_object_unref (info);
if (!ret)
- goto out;
+ return FALSE;
}
-out:
- return ret;
+ return TRUE;
}
/**