From d6a690109022210b1196487e1509b940380bee6b Mon Sep 17 00:00:00 2001 From: Dudemanguy Date: Tue, 4 Jul 2023 15:10:29 -0500 Subject: [PATCH] vo_gpu: fix some cache related memory leaks I goofed this up. --- video/out/gpu/lcms.c | 4 ++-- video/out/gpu/shader_cache.c | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/video/out/gpu/lcms.c b/video/out/gpu/lcms.c index 52345c4b9c..0ff4de8344 100644 --- a/video/out/gpu/lcms.c +++ b/video/out/gpu/lcms.c @@ -354,9 +354,9 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d, char *cache_dir = p->opts->cache_dir; if (cache_dir && cache_dir[0]) { - cache_dir = mp_get_user_path(NULL, p->global, cache_dir); + cache_dir = mp_get_user_path(tmp, p->global, cache_dir); } else { - cache_dir = mp_find_user_file(NULL, p->global, "cache", ""); + cache_dir = mp_find_user_file(tmp, p->global, "cache", ""); } cache_file = talloc_strdup(tmp, ""); diff --git a/video/out/gpu/shader_cache.c b/video/out/gpu/shader_cache.c index a046831f80..3e051730fd 100644 --- a/video/out/gpu/shader_cache.c +++ b/video/out/gpu/shader_cache.c @@ -566,6 +566,7 @@ void gl_sc_set_cache_dir(struct gl_shader_cache *sc, char *dir) dir = mp_find_user_file(NULL, sc->global, "cache", ""); } sc->cache_dir = talloc_strdup(sc, dir); + talloc_free(dir); } static bool create_pass(struct gl_shader_cache *sc, struct sc_entry *entry)