From: Alex Rousskov Date: Sat, 20 Jun 2026 16:15:17 +0000 (+0000) Subject: Do not leak memory when reading FTP CWD responses (#2445) X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;ds=sidebyside;p=thirdparty%2Fsquid.git Do not leak memory when reading FTP CWD responses (#2445) The bug affected a subset of HTTP transactions with `ftp://` URLs. It was introduced in 2009 commit 0477a072. --- diff --git a/src/clients/FtpGateway.cc b/src/clients/FtpGateway.cc index e9031ce41a..664387e8f6 100644 --- a/src/clients/FtpGateway.cc +++ b/src/clients/FtpGateway.cc @@ -1497,7 +1497,7 @@ ftpReadCwd(Ftp::Gateway * ftpState) ftpState->cwd_message.append('\n'); ftpState->cwd_message.append(w->key); } - ftpState->ctrl.message = nullptr; + wordlistDestroy(&ftpState->ctrl.message); /* Continue to traverse the path */ ftpTraverseDirectory(ftpState);