Commit 08b9f732 authored by Yang Tse's avatar Yang Tse
Browse files

Fix memory leak under low memory conditions.

parent 94162d62
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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);