mirror of
https://github.com/swaywm/sway.git
synced 2024-11-22 16:01:27 +00:00
Merge pull request #2430 from ianyfan/socketpath-leaks
Fix memory leaks in get_socketpath
This commit is contained in:
commit
1818c58e40
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue