From 14557ba81ad6630a1012430e8965c0f08edcc0f0 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Sun, 28 Oct 2001 02:45:16 +0000 Subject: Don't leak stuff. (Bug #13709) 2001-10-27 Jon Trowbridge * backend/ebook/e-book.c (activate_factories_for_uri): Don't leak stuff. (Bug #13709) svn path=/trunk/; revision=14267 --- addressbook/ChangeLog | 5 +++++ addressbook/backend/ebook/e-book.c | 25 +++++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) (limited to 'addressbook') diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index cc5f58faa6..bf648b9a2f 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,8 @@ +2001-10-27 Jon Trowbridge + + * backend/ebook/e-book.c (activate_factories_for_uri): Don't leak + stuff. (Bug #13709) + 2001-10-27 Christopher James Lahey * backend/ebook/e-destination.c (name_and_email_simple_query_cb, diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c index 41d5ec7e06..e331df149e 100644 --- a/addressbook/backend/ebook/e-book.c +++ b/addressbook/backend/ebook/e-book.c @@ -609,9 +609,10 @@ static gboolean activate_factories_for_uri (EBook *book, const char *uri) { CORBA_Environment ev; - OAF_ServerInfoList *info_list; + OAF_ServerInfoList *info_list = NULL; int i; char *protocol, *query, *colon; + gboolean retval = FALSE; colon = strchr (uri, ':'); if (!colon) { @@ -632,18 +633,16 @@ activate_factories_for_uri (EBook *book, const char *uri) if (ev._major != CORBA_NO_EXCEPTION) { g_warning ("Eeek! Cannot perform OAF query for book factories."); - return FALSE; + CORBA_exception_free (&ev); + goto shutdown; } if (info_list->_length == 0) { g_warning ("Can't find installed BookFactory that handles protocol '%s'.", protocol); - g_free (protocol); CORBA_exception_free (&ev); - return FALSE; + goto shutdown; } - g_free (protocol); - g_free (query); CORBA_exception_free (&ev); for (i = 0; i < info_list->_length; i ++) { @@ -662,14 +661,20 @@ activate_factories_for_uri (EBook *book, const char *uri) factory); } - CORBA_free (info_list); - if (!book->priv->book_factories) { g_warning ("Couldn't activate any book factories."); - return FALSE; + goto shutdown; } - return TRUE; + retval = TRUE; + + shutdown: + if (info_list) + CORBA_free (info_list); + g_free (query); + g_free (protocol); + + return retval; } gboolean -- cgit v1.2.3