imap: add a check for failing strdup()

This commit is contained in:
Daniel Stenberg 2023-08-14 13:43:33 +02:00
parent 91765104c2
commit 8a86ccf343
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

@ -1115,7 +1115,10 @@ static CURLcode imap_state_select_resp(struct Curl_easy *data, int imapcode,
}
else {
/* Note the currently opened mailbox on this connection */
DEBUGASSERT(!imapc->mailbox);
imapc->mailbox = strdup(imap->mailbox);
if(!imapc->mailbox)
return CURLE_OUT_OF_MEMORY;
if(imap->custom)
result = imap_perform_list(data);