From: Rob Bradford Date: Fri, 9 Aug 2013 10:30:38 +0000 (+0100) Subject: weston-launch: Only pass non-NULL value into setenv() X-Git-Tag: 1.2.91~128 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ac9f73c7ddfecd6f81fb907c4e61ed2339c95d8;p=platform%2Fupstream%2Fweston.git weston-launch: Only pass non-NULL value into setenv() getenv() can return NULL is the key is not set, passing NULL into setenv() is an error --- diff --git a/src/weston-launch.c b/src/weston-launch.c index 5b03094..7264f7e 100644 --- a/src/weston-launch.c +++ b/src/weston-launch.c @@ -515,7 +515,8 @@ setup_session(struct weston_launch *wl) term = getenv("TERM"); clearenv(); - setenv("TERM", term, 1); + if (term) + setenv("TERM", term, 1); setenv("USER", wl->pw->pw_name, 1); setenv("LOGNAME", wl->pw->pw_name, 1); setenv("HOME", wl->pw->pw_dir, 1);