mirror of
https://github.com/gwenhael-le-moine/sway-patched-tray-menu.git
synced 2024-12-27 21:58:16 +01:00
ipc-client: fix memory leaks in get_socketpath
This commit is contained in:
parent
17f557298e
commit
baf4604629
1 changed files with 2 additions and 0 deletions
|
@ -25,6 +25,7 @@ char *get_socketpath(void) {
|
||||||
if (line && *line) {
|
if (line && *line) {
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
free(line);
|
||||||
}
|
}
|
||||||
const char *i3sock = getenv("I3SOCK");
|
const char *i3sock = getenv("I3SOCK");
|
||||||
if (i3sock) {
|
if (i3sock) {
|
||||||
|
@ -37,6 +38,7 @@ char *get_socketpath(void) {
|
||||||
if (line && *line) {
|
if (line && *line) {
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
|
free(line);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue