From d8255e1d0881df5e83f3953164408456143a1731 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Fri, 10 Feb 2017 23:03:38 +0100 Subject: [PATCH] [pipe] Fix minor memleak --- src/inputs/pipe.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/inputs/pipe.c b/src/inputs/pipe.c index 04d9fdd7..dd4e54ad 100644 --- a/src/inputs/pipe.c +++ b/src/inputs/pipe.c @@ -801,10 +801,12 @@ stop(struct player_source *ps) // Reset the pipe and start watching it again for new data. Must be async or // we will deadlock from the stop in pipe_read_cb(). - id = malloc(sizeof(int)); - *id = pipe->id; if (pipe_autostart) - commands_exec_async(cmdbase, pipe_watch_reset, id); + { + id = malloc(sizeof(int)); + *id = pipe->id; + commands_exec_async(cmdbase, pipe_watch_reset, id); + } if (pipe_metadata) worker_execute(pipe_metadata_watch_del, NULL, 0, 0);