From: Daniel Stenberg Date: Mon, 9 Nov 2015 09:54:55 +0000 (+0100) Subject: imap: avoid freeing constant string X-Git-Tag: curl-7_46_0~91 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=f54a4aa9a383c93065735e441355c49ef42129f4;p=thirdparty%2Fcurl.git imap: avoid freeing constant string The fix in 1a614c6c3 was wrong and would leed to free() of a fixed string. Pointed-out-by: Kamil Dudka --- diff --git a/lib/imap.c b/lib/imap.c index b0809e3208..a7409f7040 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -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;