From f54a4aa9a383c93065735e441355c49ef42129f4 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 9 Nov 2015 10:54:55 +0100 Subject: 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 --- lib/imap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/imap.c b/lib/imap.c index b0809e320..a7409f704 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; -- cgit v1.2.3