From a4c1270ef0a3c5bd610b13867be7616a55e59dc5 Mon Sep 17 00:00:00 2001 From: Tony Crisci Date: Tue, 19 Dec 2017 05:38:41 -0500 Subject: [PATCH] fix memory leak in swaymsg --- swaymsg/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/swaymsg/main.c b/swaymsg/main.c index dfc175a8..b431872a 100644 --- a/swaymsg/main.c +++ b/swaymsg/main.c @@ -308,9 +308,11 @@ int main(int argc, char **argv) { } free(cmdtype); - char *command = strdup(""); + char *command = NULL; if (optind < argc) { command = join_args(argv + optind, argc - optind); + } else { + command = strdup(""); } int ret = 0;