player: fix use-after-free with --screenshot-directory

Probably fixes #3049.
This commit is contained in:
wm4 2016-04-14 22:39:10 +02:00
parent e13cc25a2c
commit 4ebac1e936
1 changed files with 2 additions and 1 deletions

View File

@ -287,9 +287,10 @@ static char *gen_fname(screenshot_ctx *ctx, const char *file_ext)
void *t = fname;
dir = mp_get_user_path(t, ctx->mpctx->global, dir);
fname = mp_path_join(NULL, dir, fname);
talloc_free(t);
mp_mkdirp(dir);
talloc_free(t);
}
if (!mp_path_exists(fname))