summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorUmang Jain <umang@endlessm.com>2019-03-26 15:47:54 +0530
committerAtomic Bot <atomic-devel@projectatomic.io>2019-03-26 12:10:52 +0000
commitdcde1473d3db14369cde96108c7f12b3d2a99c16 (patch)
tree2d7a875b2b3c30db70fc30b0c53d39e08e9c73a3 /common
parenta9107feeb4b8275b78965b36bf21b92d5724699e (diff)
downloadflatpak-dcde1473d3db14369cde96108c7f12b3d2a99c16.tar.gz
trivial: Use g_autoptr to automatically free GErrors
Closes: #2785 Approved by: matthiasclasen
Diffstat (limited to 'common')
-rw-r--r--common/flatpak-dir.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
index 2b591000..6e16ceb4 100644
--- a/common/flatpak-dir.c
+++ b/common/flatpak-dir.c
@@ -8905,13 +8905,10 @@ flatpak_dir_undeploy (FlatpakDir *self,
if (force_remove || !dir_is_locked (removed_subdir))
{
- GError *tmp_error = NULL;
+ g_autoptr(GError) tmp_error = NULL;
if (!flatpak_rm_rf (removed_subdir, cancellable, &tmp_error))
- {
- g_warning ("Unable to remove old checkout: %s", tmp_error->message);
- g_error_free (tmp_error);
- }
+ g_warning ("Unable to remove old checkout: %s", tmp_error->message);
}
return TRUE;
@@ -9063,12 +9060,9 @@ flatpak_dir_cleanup_removed (FlatpakDir *self,
if (g_file_info_get_file_type (child_info) == G_FILE_TYPE_DIRECTORY &&
!dir_is_locked (child))
{
- GError *tmp_error = NULL;
+ g_autoptr(GError) tmp_error = NULL;
if (!flatpak_rm_rf (child, cancellable, &tmp_error))
- {
- g_warning ("Unable to remove old checkout: %s", tmp_error->message);
- g_error_free (tmp_error);
- }
+ g_warning ("Unable to remove old checkout: %s", tmp_error->message);
}
g_clear_object (&child_info);