summaryrefslogtreecommitdiffstats
path: root/input
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2014-10-17 22:31:14 +0200
committerwm4 <wm4@nowhere>2014-10-17 22:31:14 +0200
commit70cc42655d622c5bc0b78e630fc40dd28ac6703e (patch)
tree9612a9f2dfe6b1486e3019125aede64b2f8b7a7a /input
parentd15df0064368652e69fdadc7e5d99c47bfaed9c6 (diff)
downloadmpv-70cc42655d622c5bc0b78e630fc40dd28ac6703e.tar.bz2
mpv-70cc42655d622c5bc0b78e630fc40dd28ac6703e.tar.xz
ipc: fix a small memory leak
Diffstat (limited to 'input')
-rw-r--r--input/ipc.c3
1 files changed, 2 insertions, 1 deletions
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);