smtp_mail: fixed another memory leak

... introduced in 7f304ab84f
This commit is contained in:
Steve Holme 2011-09-30 10:11:56 +01:00 committed by Daniel Stenberg
parent 381459fa65
commit 56ed07f7df
1 changed files with 5 additions and 2 deletions

View File

@ -808,12 +808,15 @@ static CURLcode smtp_mail(struct connectdata *conn)
if(conn->data->set.infilesize > 0) {
size = aprintf("%" FORMAT_OFF_T, data->set.infilesize);
if(!size)
if(!size) {
Curl_safefree(from);
return CURLE_OUT_OF_MEMORY;
}
}
/* send MAIL FROM */
if(size == NULL)
if(!size)
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:%s", from);
else
result = Curl_pp_sendf(&conn->proto.smtpc.pp, "MAIL FROM:%s SIZE=%s",