]> granicus.if.org Git - curl/commitdiff
imap: avoid freeing constant string
authorDaniel Stenberg <daniel@haxx.se>
Mon, 9 Nov 2015 09:54:55 +0000 (10:54 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 9 Nov 2015 09:54:55 +0000 (10:54 +0100)
The fix in 1a614c6c3 was wrong and would leed to free() of a fixed
string.

Pointed-out-by: Kamil Dudka
lib/imap.c

index b0809e3208b15e73f3900d5842c41187c3350419..a7409f70403e406762b22a6277f6933c6a0e34bc 100644 (file)
@@ -654,7 +654,7 @@ static CURLcode imap_perform_list(struct connectdata *conn)
                         imap->custom_params ? imap->custom_params : "");
   else {
     /* Make sure the mailbox is in the correct atom format if necessary */
-    mailbox = imap->mailbox ? imap_atom(imap->mailbox, true) : (char *) "";
+    mailbox = imap->mailbox ? imap_atom(imap->mailbox, true) : strdup("");
     if(!mailbox)
       return CURLE_OUT_OF_MEMORY;