Don't try to destroy a tree we didn't create.
This commit is contained in:
8
pwutil.c
8
pwutil.c
@@ -359,11 +359,15 @@ sudo_endpwent()
|
|||||||
{
|
{
|
||||||
endpwent();
|
endpwent();
|
||||||
sudo_endspent();
|
sudo_endspent();
|
||||||
|
if (pwcache_byuid != NULL) {
|
||||||
rbdestroy(pwcache_byuid, pw_free);
|
rbdestroy(pwcache_byuid, pw_free);
|
||||||
pwcache_byuid = NULL;
|
pwcache_byuid = NULL;
|
||||||
|
}
|
||||||
|
if (pwcache_byname != NULL) {
|
||||||
rbdestroy(pwcache_byname, NULL);
|
rbdestroy(pwcache_byname, NULL);
|
||||||
pwcache_byname = NULL;
|
pwcache_byname = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
pw_free(v)
|
pw_free(v)
|
||||||
@@ -551,8 +555,12 @@ void
|
|||||||
sudo_endgrent()
|
sudo_endgrent()
|
||||||
{
|
{
|
||||||
endgrent();
|
endgrent();
|
||||||
|
if (grcache_bygid != NULL) {
|
||||||
rbdestroy(grcache_bygid, free);
|
rbdestroy(grcache_bygid, free);
|
||||||
grcache_bygid = NULL;
|
grcache_bygid = NULL;
|
||||||
|
}
|
||||||
|
if (grcache_byname != NULL) {
|
||||||
rbdestroy(grcache_byname, NULL);
|
rbdestroy(grcache_byname, NULL);
|
||||||
grcache_byname = NULL;
|
grcache_byname = NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
Reference in New Issue
Block a user