From: Michael Stapelberg Date: Sat, 9 Jan 2016 11:30:15 +0000 (+0100) Subject: i3bar: fix memory leak in socket path X-Git-Tag: 4.12~57 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9dde0b9b18817e3aeb6104f2954998557f07c8ec;p=i3%2Fi3 i3bar: fix memory leak in socket path --- diff --git a/i3bar/src/main.c b/i3bar/src/main.c index 32425319..3b5d7546 100644 --- a/i3bar/src/main.c +++ b/i3bar/src/main.c @@ -137,6 +137,8 @@ int main(int argc, char **argv) { if (socket_path == NULL) { socket_path = atom_sock_path; + } else { + free(atom_sock_path); } if (socket_path == NULL) { @@ -149,6 +151,7 @@ int main(int argc, char **argv) { /* Request the bar configuration. When it arrives, we fill the config array. */ i3_send_msg(I3_IPC_MESSAGE_TYPE_GET_BAR_CONFIG, config.bar_id); } + free(socket_path); /* We listen to SIGTERM/QUIT/INT and try to exit cleanly, by stopping the main loop. * We only need those watchers on the stack, so putting them on the stack saves us