summaryrefslogtreecommitdiff
path: root/methods
diff options
context:
space:
mode:
authorHerman Semenoff <GermanAizek@yandex.ru>2026-04-08 13:09:52 +0300
committerJulian Andres Klode <jak@debian.org>2026-05-01 16:27:11 +0000
commite79f9bb22375fd72330b534e17dcd3ceace432e8 (patch)
tree467777a1a76219fe40e7dc247039773e24771951 /methods
parent8915e23a8f8c44bfba4dd42f77b9695120216820 (diff)
apt-pkg: methods: fixed many minor memleaks
Static analysis has shown that there are many minor memleaks.
Diffstat (limited to 'methods')
-rw-r--r--methods/connect.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/methods/connect.cc b/methods/connect.cc
index 828be3f50..7e740e398 100644
--- a/methods/connect.cc
+++ b/methods/connect.cc
@@ -1011,7 +1011,10 @@ ResultState UnwrapTLS(std::string const &Host, std::unique_ptr<MethodFd> &Fd,
if (auto ctx = GetContextForHost(Host, OwnerConf))
tlsFd->ssl = SSL_new(ctx);
else
+ {
+ delete tlsFd;
return ResultState::FATAL_ERROR;
+ }
FdFd *fdfd = dynamic_cast<FdFd *>(Fd.get());
if (fdfd != nullptr)