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)