aboutsummaryrefslogtreecommitdiffstats
path: root/camel/providers/imap/camel-imap-command.c
diff options
context:
space:
mode:
authorPeter Williams <peterw@ximian.com>2001-08-14 06:31:20 +0800
committerPeter Williams <peterw@src.gnome.org>2001-08-14 06:31:20 +0800
commit23aba87f9bbeb4fe8c54e499cce4059078bb3598 (patch)
tree324048b714e2ee6e3a13fd1ccc1170cb78ee2199 /camel/providers/imap/camel-imap-command.c
parent778f9780befd1f8f5514c64001c88d5b2e3292ba (diff)
downloadgsoc2013-evolution-23aba87f9bbeb4fe8c54e499cce4059078bb3598.tar
gsoc2013-evolution-23aba87f9bbeb4fe8c54e499cce4059078bb3598.tar.gz
gsoc2013-evolution-23aba87f9bbeb4fe8c54e499cce4059078bb3598.tar.bz2
gsoc2013-evolution-23aba87f9bbeb4fe8c54e499cce4059078bb3598.tar.lz
gsoc2013-evolution-23aba87f9bbeb4fe8c54e499cce4059078bb3598.tar.xz
gsoc2013-evolution-23aba87f9bbeb4fe8c54e499cce4059078bb3598.tar.zst
gsoc2013-evolution-23aba87f9bbeb4fe8c54e499cce4059078bb3598.zip
Fix a leak.
2001-08-13 Peter Williams <peterw@ximian.com> * 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
Diffstat (limited to 'camel/providers/imap/camel-imap-command.c')
-rw-r--r--camel/providers/imap/camel-imap-command.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/camel/providers/imap/camel-imap-command.c b/camel/providers/imap/camel-imap-command.c
index 9dcc56cbf8..64095b320d 100644
--- a/camel/providers/imap/camel-imap-command.c
+++ b/camel/providers/imap/camel-imap-command.c
@@ -663,8 +663,14 @@ imap_command_strdup_vprintf (CamelImapStore *store, const char *fmt,
case 'F':
string = va_arg (ap, char *);
arglen = strlen (string);
- if (*p == 'F')
- arglen += strlen (store->namespace) + 1;
+ if (*p == 'F') {
+ if (store->namespace == NULL) {
+ if (*string != '\0') /*ok if foldername is "" */
+ g_warning ("trying to list folder \"%s\" but no namespace. Hope for the best", string);
+ arglen += 2;
+ } else
+ arglen += strlen (store->namespace) + 1;
+ }
g_ptr_array_add (args, string);
if (store->capabilities & IMAP_CAPABILITY_LITERALPLUS)
len += arglen + 15;