]> granicus.if.org Git - cronie/commitdiff
Fix use of "const char *" in call to putenv().
authorTim Landscheidt <tim@tim-landscheidt.de>
Wed, 6 Jun 2012 13:57:48 +0000 (15:57 +0200)
committerMarcela Mašláňová <mmaslano@redhat.com>
Wed, 6 Jun 2012 13:57:48 +0000 (15:57 +0200)
Signed-off-by: Marcela Mašláňová <mmaslano@redhat.com>
anacron/runjob.c

index ba4dc067aef8f92d8bb3bad1a309102e9ced3fe9..32c71003c2d57ba7860037313fa29f11a2fbb1b2 100644 (file)
@@ -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