aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2018-08-06 14:08:51 -0400
committerGitHub <noreply@github.com>2018-08-06 14:08:51 -0400
commit1818c58e4060624ccb9102f88dd977702b688008 (patch)
tree68359fc53dd45f8e27f832da154027029ab73361
parent17f557298e3578323a7eeb1685ca923f7d638abc (diff)
parentbaf4604629f2e54219af1b103c58e210ce3d0952 (diff)
Merge pull request #2430 from ianyfan/socketpath-leaks
Fix memory leaks in get_socketpath
-rw-r--r--common/ipc-client.c2
1 files changed, 2 insertions, 0 deletions
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;
}