From 2dbae8ef26eaf9e48044aaf5efc64eac8aefc724 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 2 Sep 2024 17:20:26 +0200 Subject: [PATCH] widget/Registry: free the TranslateResponse, fixing more UAF bugs See commit acda23319fda8cf43c1ad006b964e107a6ee8462 --- src/widget/Registry.cxx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/widget/Registry.cxx b/src/widget/Registry.cxx index d73a96307..5e4e3e99b 100644 --- a/src/widget/Registry.cxx +++ b/src/widget/Registry.cxx @@ -66,6 +66,7 @@ WidgetRegistryLookup::OnTranslateResponse(UniquePoolPtr _resp assert(!response.views.empty()); if (response.status != HttpStatus{}) { + _response.reset(); callback(nullptr); return; } @@ -90,6 +91,8 @@ WidgetRegistryLookup::OnTranslateResponse(UniquePoolPtr _resp cls->dump_headers = response.dump_headers; cls->views = Clone(widget_pool, response.views); + _response.reset(); + cache.Put(name, *cls); callback(cls);