aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2010-05-19 12:18:06 -0700
committerDan Fandrich <dan@coneharvesters.com>2010-05-19 12:18:06 -0700
commit04cfef24a113e1477ccfafa633c468f0055a42c5 (patch)
tree073547e13ceda2186694778a0126364ba00d70a2 /lib
parent1d26151d5f895406c78d5d20fbad89604f9d9938 (diff)
Fixed some memory leaks in the POP3 torture tests
Diffstat (limited to 'lib')
-rw-r--r--lib/pop3.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/pop3.c b/lib/pop3.c
index 4d79eebb2..9609b6249 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -828,7 +828,8 @@ static CURLcode pop3_disconnect(struct connectdata *conn)
/* The POP3 session may or may not have been allocated/setup at this
point! */
- (void)pop3_quit(conn); /* ignore errors on the LOGOUT */
+ if(pop3c->pp.conn)
+ (void)pop3_quit(conn); /* ignore errors on the LOGOUT */
Curl_pp_disconnect(&pop3c->pp);
@@ -849,10 +850,11 @@ static CURLcode pop3_parse_url_path(struct connectdata *conn)
struct pop3_conn *pop3c = &conn->proto.pop3c;
struct SessionHandle *data = conn->data;
const char *path = data->state.path;
- int len;
/* url decode the path and use this mailbox */
- pop3c->mailbox = curl_easy_unescape(data, path, 0, &len);
+ pop3c->mailbox = curl_easy_unescape(data, path, 0, NULL);
+ if (!pop3c->mailbox)
+ return CURLE_OUT_OF_MEMORY;
return CURLE_OK;
}