Fixed an OOM memory leak in the FTP wildcard code
authorDan Fandrich <dan@coneharvesters.com>
Thu, 17 Jun 2010 17:56:25 +0000 (10:56 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 17 Jun 2010 17:56:25 +0000 (10:56 -0700)
lib/ftp.c

index 51276c09fa5adaceb54e0820a0be09e7ef057db8..3b13b52ccca456f1ac98190b24b528c14e5a3971 100644 (file)
--- 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;