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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=273552
@ -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