From: Steve Holme Date: Fri, 30 Sep 2011 09:11:56 +0000 (+0100) Subject: smtp_mail: fixed another memory leak X-Git-Tag: upstream/7.37.1~3626 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=56ed07f7df5b743b25711e742d31126ce0b79baf;p=platform%2Fupstream%2Fcurl.git smtp_mail: fixed another memory leak ... introduced in 7f304ab84f560c --- diff --git a/lib/smtp.c b/lib/smtp.c index dbfc589..75b008e 100644 --- a/lib/smtp.c +++ b/lib/smtp.c @@ -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",