From 08b9f7321992fd14dfe7dcd65e24069cc0ce3ed5 Mon Sep 17 00:00:00 2001 From: Yang Tse Date: Tue, 2 Oct 2007 19:19:47 +0000 Subject: Fix memory leak under low memory conditions. --- lib/ftp.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/ftp.c b/lib/ftp.c index f092cbb3a..1cb5d14da 100644 --- 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); -- cgit v1.2.3