Test if 'env' is NULL before doing memset() and strlen(),
the caller may pass NULL to freeenv().
This commit is contained in:
parent
bdb4291f89
commit
2735a91d93
@ -262,7 +262,7 @@ void
|
||||
freeenv(char *env)
|
||||
{
|
||||
|
||||
if (dynamic_kenv) {
|
||||
if (dynamic_kenv && env != NULL) {
|
||||
memset(env, 0, strlen(env));
|
||||
free(env, M_KENV);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user