aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2011-03-17 16:28:12 -0700
committerDan Fandrich <dan@coneharvesters.com>2011-03-17 16:28:12 -0700
commit409867e62bf1b12e0fa0d39007256b5807a60cea (patch)
treec16a51124a56287ff5b79647b169a13432f4c804
parent929aeed38618fe96f6105b61c10feedc81257dbb (diff)
pop3: fixed memory leak in an error retrieval case
-rw-r--r--lib/pop3.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/pop3.c b/lib/pop3.c
index d6e63035b..65169cff5 100644
--- a/lib/pop3.c
+++ b/lib/pop3.c
@@ -690,6 +690,7 @@ static CURLcode pop3_done(struct connectdata *conn, CURLcode status,
{
struct SessionHandle *data = conn->data;
struct FTP *pop3 = data->state.proto.pop3;
+ struct pop3_conn *pop3c = &conn->proto.pop3c;
CURLcode result=CURLE_OK;
(void)premature;
@@ -706,6 +707,9 @@ static CURLcode pop3_done(struct connectdata *conn, CURLcode status,
result = status; /* use the already set error code */
}
+ free(pop3c->mailbox);
+ pop3c->mailbox = NULL;
+
/* clear these for next connection */
pop3->transfer = FTPTRANSFER_BODY;
@@ -884,8 +888,6 @@ static CURLcode pop3_dophase_done(struct connectdata *conn,
/* no data to transfer */
Curl_setup_transfer(conn, -1, -1, FALSE, NULL, -1, NULL);
- free(pop3c->mailbox);
-
return CURLE_OK;
}