]> granicus.if.org Git - curl/commitdiff
Fixed a couple of out of memory leaks and a segfault in the SMTP code.
authorDan Fandrich <dan@coneharvesters.com>
Thu, 25 Feb 2010 08:07:06 +0000 (08:07 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 25 Feb 2010 08:07:06 +0000 (08:07 +0000)
CHANGES
lib/smtp.c

diff --git a/CHANGES b/CHANGES
index d6013b782c69070f62f16e7a19a415a7c852c8f9..ae09307070cafd397d162b0b384ff40e8ac66fb9 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -6,6 +6,9 @@
 
                                   Changelog
 
+Daniel Fandrich (25 Feb 2010)
+- Fixed a couple of out of memory leaks and a segfault in the SMTP code.
+
 Yang Tse (25 Feb 2010)
 - I fixed bug report #2958074 indicating
   (http://curl.haxx.se/bug/view.cgi?id=2958074) that curl on Windows with
index d14c44be4085bfe65c7f54a761f1e8525e73435c..2587934cf86068506d5e83ce5e6d40c957354e08 100644 (file)
@@ -724,6 +724,8 @@ static CURLcode smtp_connect(struct connectdata *conn,
 
   /* url decode the path and use it as domain with EHLO */
   smtpc->domain = curl_easy_unescape(conn->data, path, 0, &len);
+  if (!smtpc->domain)
+    return CURLE_OUT_OF_MEMORY;
 
   /* When we connect, we start in the state where we await the server greeting
    */
@@ -917,7 +919,8 @@ static CURLcode smtp_disconnect(struct connectdata *conn)
 
   /* The SMTP session may or may not have been allocated/setup at this
      point! */
-  (void)smtp_quit(conn); /* ignore errors on the LOGOUT */
+  if (smtpc->pp.conn)
+    (void)smtp_quit(conn); /* ignore errors on the LOGOUT */
 
   Curl_pp_disconnect(&smtpc->pp);