From: Tobias Brunner Date: Tue, 4 Mar 2025 14:27:53 +0000 (+0100) Subject: winhttp: Properly destroy linked list if connection can't be opened X-Git-Tag: 6.0.1~5 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=380ec66c92d48f6144cc21a0117523e6401c64c3;p=thirdparty%2Fstrongswan.git winhttp: Properly destroy linked list if connection can't be opened --- diff --git a/src/libstrongswan/plugins/winhttp/winhttp_fetcher.c b/src/libstrongswan/plugins/winhttp/winhttp_fetcher.c index aad6811af4..e387bbb937 100644 --- a/src/libstrongswan/plugins/winhttp/winhttp_fetcher.c +++ b/src/libstrongswan/plugins/winhttp/winhttp_fetcher.c @@ -359,7 +359,10 @@ METHOD(fetcher_t, set_option, bool, METHOD(fetcher_t, destroy, void, private_winhttp_fetcher_t *this) { - WinHttpCloseHandle(this->session); + if (this->session) + { + WinHttpCloseHandle(this->session); + } this->headers->destroy_function(this->headers, free); free(this); } @@ -389,7 +392,7 @@ winhttp_fetcher_t *winhttp_fetcher_create() if (!this->session) { - free(this); + destroy(this); return NULL; }