[gvfs] afp: fix potential leak in g_vfs_afp_volume_enumerate



commit f30a3c75f0102c69502edff77c6dba3775d90569
Author: Carl-Anton Ingmarsson <ca ingmarsson gmail com>
Date:   Sun Jan 22 17:15:52 2012 +0100

    afp: fix potential leak in g_vfs_afp_volume_enumerate

 daemon/gvfsafpvolume.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/daemon/gvfsafpvolume.c b/daemon/gvfsafpvolume.c
index 5bc6032..b69056c 100644
--- a/daemon/gvfsafpvolume.c
+++ b/daemon/gvfsafpvolume.c
@@ -2498,7 +2498,8 @@ enumerate_cb (GObject *source_object, GAsyncResult *res, gpointer user_data)
   }
   g_object_unref (reply);
 
-  g_simple_async_result_set_op_res_gpointer (simple, infos, NULL);
+  g_simple_async_result_set_op_res_gpointer (simple, infos,
+                                             (GDestroyNotify)g_ptr_array_unref);
   
 done:
   g_simple_async_result_complete (simple);
@@ -2624,6 +2625,8 @@ g_vfs_afp_volume_enumerate_finish (GVfsAfpVolume  *volume,
     return FALSE;
 
   *infos = g_simple_async_result_get_op_res_gpointer (simple);
+  if (*infos)
+    g_ptr_array_ref (*infos);
   
   return TRUE;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]