From 0df3e0eda1cfbcbe4e9f3e83c98686ea9cdb1fb2 Mon Sep 17 00:00:00 2001 From: Marvin Scholz Date: Mon, 9 Jul 2018 03:58:08 +0200 Subject: [PATCH] Fix: Correct clearing of XSLT cache entry Fix a double free that could happen when the cache was cleared during config reload and then subsequent XSLT requests would try to evict the same cache item, because the item name was not set to NULL in clear_cache_entry. Previously this was no problem as a cache entry would only be evicted on load of a new XSLT and that one would immediately fill in the place of the old one. --- src/xslt.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/xslt.c b/src/xslt.c index de321f55..1a14d984 100644 --- a/src/xslt.c +++ b/src/xslt.c @@ -129,6 +129,7 @@ static void clear_cache_entry(size_t idx) { free(cache[idx].filename); if (cache[idx].stylesheet) xsltFreeStylesheet(cache[idx].stylesheet); + cache[idx].filename = NULL; } void xslt_clear_cache(void)