diff --git a/lib/imap.c b/lib/imap.c index 29784e9e82..9d39cc6d0e 100644 --- a/lib/imap.c +++ b/lib/imap.c @@ -701,10 +701,10 @@ static CURLcode imap_select(struct connectdata *conn) /* Make sure the mailbox is in the correct atom format */ mailbox = imap_atom(imap->mailbox); if(!mailbox) - result = CURLE_OUT_OF_MEMORY; - else - /* Send the SELECT command */ - result = imap_sendf(conn, "SELECT %s", mailbox); + return CURLE_OUT_OF_MEMORY; + + /* Send the SELECT command */ + result = imap_sendf(conn, "SELECT %s", mailbox); Curl_safefree(mailbox);