From b4d77c371974b294c0d6692bd6d170a69170bdd6 Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 11 Oct 2009 19:43:18 -0400 Subject: [PATCH] Fix small memory leak. --- cmd/wmii/main.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmd/wmii/main.c b/cmd/wmii/main.c index 99fc6e86..cf0a8fd9 100644 --- a/cmd/wmii/main.c +++ b/cmd/wmii/main.c @@ -290,10 +290,11 @@ void spawn_command(const char *cmd) { char *shell, *p; - if((p = pathsearch(getenv("WMII_CONFPATH"), cmd, true))) - cmd = p; if(doublefork() == 0) { + if((p = pathsearch(getenv("WMII_CONFPATH"), cmd, true))) + cmd = p; + if(setsid() == -1) fatal("Can't setsid: %r");