From 21f3c8db00f0d4a3f0989559847d2564f4c73a11 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 20 Oct 2014 19:56:05 -0500 Subject: More static analysis fixes from Ashwini Sharma. --- toys/posix/nohup.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'toys/posix/nohup.c') diff --git a/toys/posix/nohup.c b/toys/posix/nohup.c index 0cece0b5..df264da2 100644 --- a/toys/posix/nohup.c +++ b/toys/posix/nohup.c @@ -28,8 +28,10 @@ void nohup_main(void) S_IRUSR|S_IWUSR )) { char *temp = getenv("HOME"); + temp = xmprintf("%s/%s", temp ? temp : "", "nohup.out"); xcreate(temp, O_CREAT|O_APPEND|O_WRONLY, 0600); + free(temp); } } if (isatty(0)) { -- cgit v1.2.3