From 70cc42655d622c5bc0b78e630fc40dd28ac6703e Mon Sep 17 00:00:00 2001 From: wm4 Date: Fri, 17 Oct 2014 22:31:14 +0200 Subject: ipc: fix a small memory leak --- input/ipc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/input/ipc.c b/input/ipc.c index e76a9af5e6..a8f9d7868e 100644 --- a/input/ipc.c +++ b/input/ipc.c @@ -474,6 +474,7 @@ static void *client_thread(void *p) int rc; struct client_arg *arg = p; + bstr client_msg = { talloc_strdup(NULL, ""), 0 }; int pipe_fd = mpv_get_wakeup_pipe(arg->client); if (pipe_fd < 0) { @@ -490,7 +491,6 @@ static void *client_thread(void *p) fcntl(arg->client_fd, F_SETFL, fcntl(arg->client_fd, F_GETFL, 0) | O_NONBLOCK); - bstr client_msg = { talloc_strdup(NULL, ""), 0 }; while (1) { rc = poll(fds, 2, -1); if (rc < 0) { @@ -581,6 +581,7 @@ command_done: } done: + talloc_free(client_msg.start); close(arg->client_fd); mpv_detach_destroy(arg->client); talloc_free(arg); -- cgit v1.2.3