From 43619079f878c0cafbc9bc840f2f2c0951bda3c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Duval?= Date: Tue, 5 Aug 2008 22:06:21 +0000 Subject: [PATCH] sManagedEnviron is already checked for NULL value in free_variables() git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@26830 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/libroot/posix/stdlib/env.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/system/libroot/posix/stdlib/env.c b/src/system/libroot/posix/stdlib/env.c index 8e5e8cf5b8..d38044f25e 100644 --- a/src/system/libroot/posix/stdlib/env.c +++ b/src/system/libroot/posix/stdlib/env.c @@ -130,10 +130,8 @@ copy_environ_to_heap_if_needed(void) if (environ == sManagedEnviron) return B_OK; - if (sManagedEnviron != NULL) { - // free previously used "environ"; it has been changed by an application - free_variables(); - } + // free previously used "environ" if it has been changed by an application + free_variables(); sManagedEnviron = malloc((count_variables() + 1) * sizeof(char *)); if (sManagedEnviron == NULL)