[gvfs] udisks2: plug a memory leak
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs] udisks2: plug a memory leak
- Date: Thu, 12 Jul 2012 00:00:31 +0000 (UTC)
commit 079c5ae819e9aba6e75a0b533ed5ff8308038c2d
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Tue Jul 10 14:49:35 2012 -0400
udisks2: plug a memory leak
We were not free-ing the UnmountMountsOp structure when there was an
error in one mount. Fix that and use g_list_free_full to make code more
concise.
https://bugzilla.gnome.org/show_bug.cgi?id=676111
monitor/udisks2/gvfsudisks2drive.c | 14 +++++---------
1 files changed, 5 insertions(+), 9 deletions(-)
---
diff --git a/monitor/udisks2/gvfsudisks2drive.c b/monitor/udisks2/gvfsudisks2drive.c
index 87747ac..c57931d 100644
--- a/monitor/udisks2/gvfsudisks2drive.c
+++ b/monitor/udisks2/gvfsudisks2drive.c
@@ -444,13 +444,10 @@ typedef struct {
static void
free_unmount_mounts_op (UnmountMountsOp *data)
{
- GList *l;
- for (l = data->pending_mounts; l != NULL; l = l->next)
- {
- GMount *mount = G_MOUNT (l->data);
- g_object_unref (mount);
- }
- g_list_free (data->pending_mounts);
+ g_list_free_full (data->pending_mounts, g_object_unref);
+
+ g_object_unref (data->drive);
+ g_free (data);
}
static void
@@ -470,8 +467,7 @@ unmount_mounts_do (UnmountMountsOp *data)
data->user_data,
data->on_all_unmounted_data);
- g_object_unref (data->drive);
- g_free (data);
+ free_unmount_mounts_op (data);
}
else
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]