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
This commit is contained in:
@@ -130,10 +130,8 @@ copy_environ_to_heap_if_needed(void)
|
|||||||
if (environ == sManagedEnviron)
|
if (environ == sManagedEnviron)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
if (sManagedEnviron != NULL) {
|
// free previously used "environ" if it has been changed by an application
|
||||||
// free previously used "environ"; it has been changed by an application
|
free_variables();
|
||||||
free_variables();
|
|
||||||
}
|
|
||||||
|
|
||||||
sManagedEnviron = malloc((count_variables() + 1) * sizeof(char *));
|
sManagedEnviron = malloc((count_variables() + 1) * sizeof(char *));
|
||||||
if (sManagedEnviron == NULL)
|
if (sManagedEnviron == NULL)
|
||||||
|
|||||||
Reference in New Issue
Block a user