smtp: fix memory leak in OOM

Regression since ce0881edee

Coverity CID 1418139 and CID 1418136 found it, but it was also seen in
torture testing.
This commit is contained in:
Daniel Stenberg 2017-09-20 11:33:46 +02:00
parent 7f794a224e
commit 1e548f7784
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
1 changed files with 4 additions and 1 deletions

View File

@ -550,8 +550,11 @@ static CURLcode smtp_perform_mail(struct connectdata *conn)
if(!result)
result = Curl_mime_rewind(&data->set.mimepost);
if(result)
if(result) {
free(from);
free(auth);
return result;
}
data->state.infilesize = Curl_mime_size(&data->set.mimepost);