]> granicus.if.org Git - curl/commitdiff
Fix memory leak under low memory conditions.
authorYang Tse <yangsita@gmail.com>
Tue, 2 Oct 2007 19:19:47 +0000 (19:19 +0000)
committerYang Tse <yangsita@gmail.com>
Tue, 2 Oct 2007 19:19:47 +0000 (19:19 +0000)
lib/ftp.c

index f092cbb3a83cb5b6f8c263f9bdbe720ee1ad6919..1cb5d14dad64465e8a7cf14b495bdcaa7ab38371 100644 (file)
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1316,8 +1316,11 @@ static CURLcode ftp_state_post_listtype(struct connectdata *conn)
                  lstArg? " ": "",
                  lstArg? lstArg: "" );
 
-  if(!cmd)
+  if(!cmd) {
+    if(lstArg)
+      free(lstArg);
     return CURLE_OUT_OF_MEMORY;
+  }
 
   NBFTPSENDF(conn, "%s",cmd);