When I3SOCK is present, socket_path might be a pointer to an
environment variable, which cannot be free'd in line 157. This
commit duplicates the string if I3SOCK is present, thus making
socket_path a free-able pointer again.
int opt;
int option_index = 0;
char *socket_path = getenv("I3SOCK");
+ if (socket_path != NULL) {
+ socket_path = sstrdup(socket_path);
+ }
char *i3_default_sock_path = "/tmp/i3-ipc.sock";
/* Initialize the standard config to use 0 as default */