diff options
author | 2018-08-06 14:08:51 -0400 | |
---|---|---|
committer | 2018-08-06 14:08:51 -0400 | |
commit | 1818c58e4060624ccb9102f88dd977702b688008 (patch) | |
tree | 68359fc53dd45f8e27f832da154027029ab73361 /common/ipc-client.c | |
parent | Merge pull request #2428 from RyanDwyer/workspace-move-to-output (diff) | |
parent | ipc-client: fix memory leaks in get_socketpath (diff) | |
download | sway-1818c58e4060624ccb9102f88dd977702b688008.tar.gz sway-1818c58e4060624ccb9102f88dd977702b688008.tar.zst sway-1818c58e4060624ccb9102f88dd977702b688008.zip |
Merge pull request #2430 from ianyfan/socketpath-leaks
Fix memory leaks in get_socketpath
Diffstat (limited to 'common/ipc-client.c')
-rw-r--r-- | common/ipc-client.c | 2 |
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) { | |||
25 | if (line && *line) { | 25 | if (line && *line) { |
26 | return line; | 26 | return line; |
27 | } | 27 | } |
28 | free(line); | ||
28 | } | 29 | } |
29 | const char *i3sock = getenv("I3SOCK"); | 30 | const char *i3sock = getenv("I3SOCK"); |
30 | if (i3sock) { | 31 | if (i3sock) { |
@@ -37,6 +38,7 @@ char *get_socketpath(void) { | |||
37 | if (line && *line) { | 38 | if (line && *line) { |
38 | return line; | 39 | return line; |
39 | } | 40 | } |
41 | free(line); | ||
40 | } | 42 | } |
41 | return NULL; | 43 | return NULL; |
42 | } | 44 | } |