]> granicus.if.org Git - curl/commitdiff
imap: Don't call imap_atom() when no mailbox specified in LIST command
authorSteve Holme <steve_holme@hotmail.com>
Fri, 6 Nov 2015 21:49:26 +0000 (21:49 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Fri, 6 Nov 2015 21:49:26 +0000 (21:49 +0000)
lib/imap.c

index e6d83f2cf86832728a79c7397d39ad57cd2b893b..8d805e83d250bb1250f19f2d623ffd200793c631 100644 (file)
@@ -653,8 +653,8 @@ static CURLcode imap_perform_list(struct connectdata *conn)
     result = imap_sendf(conn, "%s%s", imap->custom,
                         imap->custom_params ? imap->custom_params : "");
   else {
-    /* Make sure the mailbox is in the correct atom format */
-    mailbox = imap_atom(imap->mailbox ? imap->mailbox : "");
+    /* Make sure the mailbox is in the correct atom format if necessary */
+    mailbox = imap->mailbox ? imap_atom(imap->mailbox) : "";
     if(!mailbox)
       return CURLE_OUT_OF_MEMORY;