From bd6a695545966b05a99eb7eac74bb20715ead8dd Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 17 Jun 2010 10:56:25 -0700 Subject: [PATCH] Fixed an OOM memory leak in the FTP wildcard code --- lib/ftp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ftp.c b/lib/ftp.c index 51276c09fa..3b13b52ccc 100644 --- a/lib/ftp.c +++ b/lib/ftp.c @@ -3526,8 +3526,10 @@ static CURLcode init_wc_data(struct connectdata *conn) /* INITIALIZE parselist structure */ ftp_tmp->parser = Curl_ftp_parselist_data_alloc(); - if(!ftp_tmp->parser) + if(!ftp_tmp->parser) { + free(ftp_tmp); return CURLE_OUT_OF_MEMORY; + } wildcard->tmp = ftp_tmp; /* put it to the WildcardData tmp pointer */ wildcard->tmp_dtor = wc_data_dtor;