Merge pull request #417 from jubalh/doublefree

Only free sgent if it was initialized
This commit is contained in:
Serge Hallyn 2021-09-27 10:10:22 -05:00 committed by GitHub
commit 5bb28a0a7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1207,11 +1207,13 @@ int main (int argc, char **argv)
sssd_flush_cache (SSSD_DB_GROUP);
#ifdef SHADOWGRP
if (sgent.sg_adm) {
xfree(sgent.sg_adm);
}
if (sgent.sg_mem) {
xfree(sgent.sg_mem);
if (is_shadowgrp) {
if (sgent.sg_adm) {
xfree(sgent.sg_adm);
}
if (sgent.sg_mem) {
xfree(sgent.sg_mem);
}
}
#endif
if (grent.gr_mem) {