From: Tim Landscheidt Date: Wed, 6 Jun 2012 13:57:48 +0000 (+0200) Subject: Fix use of "const char *" in call to putenv(). X-Git-Tag: cronie1.4.9~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0be67c5400586fe8a445fd12e7c56c23aa52e9dc;p=cronie Fix use of "const char *" in call to putenv(). Signed-off-by: Marcela Mašláňová --- diff --git a/anacron/runjob.c b/anacron/runjob.c index ba4dc06..32c7100 100644 --- a/anacron/runjob.c +++ b/anacron/runjob.c @@ -97,7 +97,9 @@ username() static void xputenv(const char *s) { - if (putenv(s)) die_e("Can't set the environment"); + char *copy = strdup (s); + if (!copy) die_e("Not enough memory to set the environment"); + if (putenv(copy)) die_e("Can't set the environment"); } static void