summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-09-20 11:33:46 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-09-20 11:33:46 +0200
commit1e548f77847ac51a7054adef24825624fb73b219 (patch)
tree055abe4010b104a59d7095006f576f9bf6f0d87e
parent7f794a224e800b8b1bf3dfed353ceb825094b722 (diff)
downloadcurl-1e548f77847ac51a7054adef24825624fb73b219.tar.gz
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.
-rw-r--r--lib/smtp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index 67dc04f28..de2dd3356 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -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);