smtp_mail: fixed another memory leak
authorSteve Holme <steve_holme@hotmail.com>
Fri, 30 Sep 2011 09:11:56 +0000 (10:11 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 3 Oct 2011 20:55:25 +0000 (22:55 +0200)
... introduced in 7f304ab84f560c

lib/smtp.c

index dbfc589..75b008e 100644 (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",