tdecacqu / rpms / systemd

Forked from rpms/systemd 3 years ago
Clone
46a556f
From 652bba47f77d7ba9583f91d2322221ef2e7c4d07 Mon Sep 17 00:00:00 2001
b356b73
From: Harald Hoyer <harald@redhat.com>
b356b73
Date: Thu, 18 Apr 2013 07:15:03 +0200
b356b73
Subject: [PATCH] core/execute: only clean the environment, if we have one
b356b73
 (cherry picked from commit 5521d6985648669a65d0529bb01c7a32edc99294)
b356b73
b356b73
---
b356b73
 src/core/execute.c | 3 ++-
b356b73
 1 file changed, 2 insertions(+), 1 deletion(-)
b356b73
b356b73
diff --git a/src/core/execute.c b/src/core/execute.c
b356b73
index 4b29d8e..11993df 100644
b356b73
--- a/src/core/execute.c
b356b73
+++ b/src/core/execute.c
b356b73
@@ -1757,7 +1757,8 @@ int exec_context_load_environment(const ExecContext *c, char ***l) {
b356b73
                                 return k;
b356b73
                          }
b356b73
                         /* Log invalid environment variables with filename */
b356b73
-                        p = strv_env_clean_log(p, pglob.gl_pathv[n]);
b356b73
+			if (p)
b356b73
+	                        p = strv_env_clean_log(p, pglob.gl_pathv[n]);
b356b73
 
b356b73
                         if (r == NULL)
b356b73
                                 r = p;