mirror of
https://github.com/mpv-player/mpv
synced 2025-02-20 14:56:55 +00:00
player: properly destroy client context if thread can't be created
Minor leak in an obscure out of memory case.
(cherry picked from commit d01228058b
)
This commit is contained in:
parent
a4ba496539
commit
b99f78412b
@ -135,8 +135,11 @@ static void mp_load_script(struct MPContext *mpctx, const char *fname)
|
||||
MP_VERBOSE(arg, "Loading script %s...\n", fname);
|
||||
|
||||
pthread_t thread;
|
||||
if (pthread_create(&thread, NULL, script_thread, arg))
|
||||
if (pthread_create(&thread, NULL, script_thread, arg)) {
|
||||
mpv_detach_destroy(arg->client);
|
||||
talloc_free(arg);
|
||||
return;
|
||||
}
|
||||
|
||||
wait_loaded(mpctx);
|
||||
MP_VERBOSE(mpctx, "Done loading %s.\n", fname);
|
||||
|
Loading…
Reference in New Issue
Block a user