From 7f1d018c3b5647c1581c281b463426d66e1aab6b Mon Sep 17 00:00:00 2001 From: Rodrigo Arias Mallo Date: Tue, 12 Aug 2025 16:08:21 +0200 Subject: Fix internal page leak A copy of the buffer is done while injecting the content for about:cache and about:dicache, so the Dstr needs to be free'd after. --- src/cache.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cache.c b/src/cache.c index 5a852167..3dc2eb8b 100644 --- a/src/cache.c +++ b/src/cache.c @@ -283,6 +283,9 @@ static int Cache_bufsize(CacheEntry_t *e) /** * Inject full page content directly into the cache. * Used for "about:splash". May be used for "about:cache" too. + * + * The @param data_ds buffer is copied into the entry buffer, so it is + * responsibility of the caller to free it. */ void a_Cache_entry_inject(const DilloUrl *Url, Dstr *data_ds) { @@ -433,6 +436,7 @@ static int Cache_internal_url(CacheEntry_t *entry) if (s != NULL) { a_Cache_entry_inject(entry->Url, s); + dStr_free(s, 1); /* Remove InternalUrl */ entry->Flags = CA_GotHeader + CA_GotLength; } -- cgit v1.2.3