diff options
author | wm4 <wm4@nowhere> | 2015-04-30 21:57:08 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-04-30 21:57:08 +0200 |
commit | d01228058b03df33a3c6be3acbf2757019a9cd83 (patch) | |
tree | cc8aa0c129f310d1db37caa0d707d495c523637e /player/scripting.c | |
parent | 8c7f3adb413ccea35aef3878f020d6a10e9ad5de (diff) | |
download | mpv-d01228058b03df33a3c6be3acbf2757019a9cd83.tar.bz2 mpv-d01228058b03df33a3c6be3acbf2757019a9cd83.tar.xz |
player: properly destroy client context if thread can't be created
Minor leak in an obscure out of memory case.
Diffstat (limited to 'player/scripting.c')
-rw-r--r-- | player/scripting.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/player/scripting.c b/player/scripting.c index d8fbb6f84e..3747f50884 100644 --- a/player/scripting.c +++ b/player/scripting.c @@ -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); |