summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/util.c b/util.c
index 6e5ef47289..3b496edb98 100644
--- a/util.c
+++ b/util.c
@@ -1350,6 +1350,7 @@ char *nam, *val;
environ = tmpenv; /* tell exec where it is now */
}
if (!val) {
+ if (environ[i]) Safefree(environ[i]);
while (environ[i]) {
environ[i] = environ[i+1];
i++;