aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-10-28 10:45:16 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-10-28 10:45:16 +0800
commit14557ba81ad6630a1012430e8965c0f08edcc0f0 (patch)
tree6bf0484d6d2f26317551bdfa30ce6e1e28f7827f /addressbook/backend
parent70708440caf29c52e8d2a07872304a4874590fbe (diff)
downloadgsoc2013-evolution-14557ba81ad6630a1012430e8965c0f08edcc0f0.tar
gsoc2013-evolution-14557ba81ad6630a1012430e8965c0f08edcc0f0.tar.gz
gsoc2013-evolution-14557ba81ad6630a1012430e8965c0f08edcc0f0.tar.bz2
gsoc2013-evolution-14557ba81ad6630a1012430e8965c0f08edcc0f0.tar.lz
gsoc2013-evolution-14557ba81ad6630a1012430e8965c0f08edcc0f0.tar.xz
gsoc2013-evolution-14557ba81ad6630a1012430e8965c0f08edcc0f0.tar.zst
gsoc2013-evolution-14557ba81ad6630a1012430e8965c0f08edcc0f0.zip
Don't leak stuff. (Bug #13709)
2001-10-27 Jon Trowbridge <trow@ximian.com> * backend/ebook/e-book.c (activate_factories_for_uri): Don't leak stuff. (Bug #13709) svn path=/trunk/; revision=14267
Diffstat (limited to 'addressbook/backend')
-rw-r--r--addressbook/backend/ebook/e-book.c25
1 files changed, 15 insertions, 10 deletions
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