aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2010-02-25 08:07:06 +0000
committerDan Fandrich <dan@coneharvesters.com>2010-02-25 08:07:06 +0000
commitcce81a7f4508fb7b80d20432341bc265f145f26c (patch)
tree1acf28b6610d06e4b2cd09680a4436ca1933f310 /lib
parent4ad984043e797742089ee32b5194be69f2120908 (diff)
Fixed a couple of out of memory leaks and a segfault in the SMTP code.
Diffstat (limited to 'lib')
-rw-r--r--lib/smtp.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/smtp.c b/lib/smtp.c
index d14c44be4..2587934cf 100644
--- a/lib/smtp.c
+++ b/lib/smtp.c
@@ -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);