[gnome-keyring] [library] Fix possible memory leak in error condition.



commit ea5fe6215b7a0c25e6f1344b0102a46e4ee175a1
Author: Stef Walter <stef memberwebs com>
Date:   Wed Oct 21 01:58:09 2009 +0000

    [library] Fix possible memory leak in error condition.

 library/gnome-keyring-proto.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/library/gnome-keyring-proto.c b/library/gnome-keyring-proto.c
index 06f9266..4f31f96 100644
--- a/library/gnome-keyring-proto.c
+++ b/library/gnome-keyring-proto.c
@@ -722,8 +722,6 @@ gkr_proto_decode_acl (EggBuffer *buffer, gsize offset, gsize *next_offset,
 	}
 
 	for (i = 0; i < list_size; i++) {
-		ac = g_new0 (GnomeKeyringAccessControl, 1);
-		ref = g_new0 (GnomeKeyringApplicationRef, 1);
 		if (!gkr_proto_get_utf8_string (buffer,
 							  offset, &offset,
 							  &display_name)) {
@@ -741,8 +739,10 @@ gkr_proto_decode_acl (EggBuffer *buffer, gsize offset, gsize *next_offset,
 			g_free (pathname);
 			goto bail;
 		}
+		ref = g_new0 (GnomeKeyringApplicationRef, 1);
 		ref->display_name = display_name;
 		ref->pathname = pathname;
+		ac = g_new0 (GnomeKeyringAccessControl, 1);
 		ac->application = ref;
 		ac->types_allowed = types_allowed;
 		acl = g_list_append (acl, ac);
@@ -757,7 +757,7 @@ gkr_proto_decode_acl (EggBuffer *buffer, gsize offset, gsize *next_offset,
 	return TRUE;
 	
  bail:
-	g_list_free (acl);
+	gnome_keyring_acl_free (acl);
 	return FALSE;
 }
 



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