From baf4604629f2e54219af1b103c58e210ce3d0952 Mon Sep 17 00:00:00 2001 From: Ian Fan Date: Mon, 6 Aug 2018 13:58:12 +0100 Subject: [PATCH] ipc-client: fix memory leaks in get_socketpath --- common/ipc-client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/ipc-client.c b/common/ipc-client.c index 4d2d88cc..24a2f9c2 100644 --- a/common/ipc-client.c +++ b/common/ipc-client.c @@ -25,6 +25,7 @@ char *get_socketpath(void) { if (line && *line) { return line; } + free(line); } const char *i3sock = getenv("I3SOCK"); if (i3sock) { @@ -37,6 +38,7 @@ char *get_socketpath(void) { if (line && *line) { return line; } + free(line); } return NULL; }