From 23aba87f9bbeb4fe8c54e499cce4059078bb3598 Mon Sep 17 00:00:00 2001 From: Peter Williams Date: Mon, 13 Aug 2001 22:31:20 +0000 Subject: Fix a leak. 2001-08-13 Peter Williams * providers/imap/camel-imap-store.c (delete_folder): Fix a leak. * providers/imap/camel-imap-utils.c (imap_namespace_concat): Bleah, handle when namespace = NULL (can happen upon initial open of mailbox.) * providers/imap/camel-imap-command.c (imap_command_strdup_vprintf): Don't crash when %F'ing with an empty folder name and NULL namespace. svn path=/trunk/; revision=11971 --- camel/providers/imap/camel-imap-utils.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'camel/providers/imap/camel-imap-utils.c') diff --git a/camel/providers/imap/camel-imap-utils.c b/camel/providers/imap/camel-imap-utils.c index a449ea228d..df8ddc4f0e 100644 --- a/camel/providers/imap/camel-imap-utils.c +++ b/camel/providers/imap/camel-imap-utils.c @@ -773,11 +773,20 @@ imap_concat (CamelImapStore *imap_store, const char *prefix, const char *suffix) char * imap_namespace_concat (CamelImapStore *store, const char *name) { - if (!name || *name == '\0') - return g_strdup (store->namespace); - + if (!name || *name == '\0') { + if (store->namespace) + return g_strdup (store->namespace); + else + return g_strdup (""); + } + if (!g_strcasecmp (name, "INBOX")) return g_strdup ("INBOX"); + if (store->namespace == NULL) { + g_warning ("Trying to concat NULL namespace to \"%s\"!", name); + return g_strdup (name); + } + return imap_concat (store, store->namespace, name); } -- cgit v1.2.3