Fix sudo_getgrgid reference count bug when gid doesn't exist.

This one was missed when the other user/group lookup functions
were fixed.
This commit is contained in:
Todd C. Miller
2021-02-12 19:27:47 -07:00
parent df2931588a
commit 520db741b5

View File

@@ -561,7 +561,8 @@ done:
item->d.gr ? item->d.gr->gr_name : "unknown",
item->registry, node ? "cache hit" : "cached");
}
item->refcnt++;
if (item->d.gr != NULL)
item->refcnt++;
debug_return_ptr(item->d.gr);
}