vo_gpu: fix some cache related memory leaks

I goofed this up.
This commit is contained in:
Dudemanguy 2023-07-04 15:10:29 -05:00
parent dbc0fcea1b
commit d6a6901090
2 changed files with 3 additions and 2 deletions

View File

@ -354,9 +354,9 @@ bool gl_lcms_get_lut3d(struct gl_lcms *p, struct lut3d **result_lut3d,
char *cache_dir = p->opts->cache_dir; char *cache_dir = p->opts->cache_dir;
if (cache_dir && cache_dir[0]) { 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 { } 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, ""); cache_file = talloc_strdup(tmp, "");

View File

@ -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", ""); dir = mp_find_user_file(NULL, sc->global, "cache", "");
} }
sc->cache_dir = talloc_strdup(sc, dir); sc->cache_dir = talloc_strdup(sc, dir);
talloc_free(dir);
} }
static bool create_pass(struct gl_shader_cache *sc, struct sc_entry *entry) static bool create_pass(struct gl_shader_cache *sc, struct sc_entry *entry)