From d9dd245bcc420f2e0d151fe5f1ee659463222221 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 22 Jan 2011 17:00:27 +0100 Subject: [PATCH] Bugfix: Use strdup() for the initial value of socket_path (Thanks mseed) --- i3-msg/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/i3-msg/main.c b/i3-msg/main.c index 6a51ff55..c6862fae 100644 --- a/i3-msg/main.c +++ b/i3-msg/main.c @@ -109,7 +109,7 @@ static void ipc_recv_message(int sockfd, uint32_t message_type, int main(int argc, char *argv[]) { char *socket_path; if ((socket_path = getenv("I3SOCK")) == NULL) { - socket_path = "/tmp/i3-ipc.sock"; + socket_path = strdup("/tmp/i3-ipc.sock"); } int o, option_index = 0; int message_type = I3_IPC_MESSAGE_TYPE_COMMAND; -- 2.39.5