aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/imap.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/imap.c b/lib/imap.c
index 1c4f1fa8c..dce9f3016 100644
--- a/lib/imap.c
+++ b/lib/imap.c
@@ -1089,9 +1089,15 @@ static CURLcode imap_select(struct connectdata *conn)
CURLcode result = CURLE_OK;
struct SessionHandle *data = conn->data;
struct IMAP *imap = data->state.proto.imap;
+ char *mailbox;
- result = imap_sendf(conn, "SELECT %s",
- imap->mailbox ? imap->mailbox : "");
+ mailbox = imap_atom(imap->mailbox ? imap->mailbox : "");
+ if(!mailbox)
+ result = CURLE_OUT_OF_MEMORY;
+ else
+ result = imap_sendf(conn, "SELECT %s", mailbox);
+
+ Curl_safefree(mailbox);
if(result)
return result;