From 56ed07f7df5b743b25711e742d31126ce0b79baf Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Fri, 30 Sep 2011 10:11:56 +0100 Subject: [PATCH] smtp_mail: fixed another memory leak ... introduced in 7f304ab84f560c --- lib/smtp.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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", -- 2.7.4