From 946310517262bbb9c06dc980b53c7140c6bf73e5 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Thu, 23 Mar 2023 12:08:33 +0100 Subject: [PATCH] fix: Header memory leak in http requests class --- lib/external/pattern_language | 2 +- lib/libimhex/include/hex/helpers/http_requests.hpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/external/pattern_language b/lib/external/pattern_language index 36f3c9cc8..a2fbf46b5 160000 --- a/lib/external/pattern_language +++ b/lib/external/pattern_language @@ -1 +1 @@ -Subproject commit 36f3c9cc8c3f38bb1f2540f6dbcdc842f5a67a0d +Subproject commit a2fbf46b5132f5c4a061527f4caf12d11ac0eebf diff --git a/lib/libimhex/include/hex/helpers/http_requests.hpp b/lib/libimhex/include/hex/helpers/http_requests.hpp index 774d10990..7e707dee6 100644 --- a/lib/libimhex/include/hex/helpers/http_requests.hpp +++ b/lib/libimhex/include/hex/helpers/http_requests.hpp @@ -282,6 +282,7 @@ namespace hex { curl_slist *headers = nullptr; headers = curl_slist_append(headers, "Cache-Control: no-cache"); + ON_SCOPE_EXIT { curl_slist_free_all(headers); }; for (auto &[key, value] : this->m_headers) { std::string header = hex::format("{}: {}", key, value);