mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-09-03 20:52:56 -05:00
ipa-enrollment: fix memory leaks
`smods`, `fqdn`, `sdn` were not freed. Related: https://pagure.io/freeipa/issue/9895 Signed-off-by: Viktor Ashirov <vashirov@redhat.com> Reviewed-By: Rob Crittenden <rcritten@redhat.com> Reviewed-By: Alexander Bokovoy <abbra@users.noreply.github.com>
This commit is contained in:
committed by
Florence Blanc-Renaud
parent
4a62d6141a
commit
bfc9552d56
@@ -137,7 +137,7 @@ ipa_join(Slapi_PBlock *pb)
|
||||
int is_root=0;
|
||||
char *krbLastPwdChange = NULL;
|
||||
char *fqdn = NULL;
|
||||
Slapi_Mods *smods;
|
||||
Slapi_Mods *smods = NULL;
|
||||
char *attrlist[] = {"fqdn", "krbPrincipalKey", "krbLastPwdChange", "krbPrincipalName", NULL };
|
||||
char * filter;
|
||||
|
||||
@@ -329,8 +329,13 @@ free_and_return:
|
||||
if (pbtm) {
|
||||
slapi_pblock_destroy(pbtm);
|
||||
}
|
||||
if (smods) {
|
||||
slapi_mods_free(&smods);
|
||||
}
|
||||
|
||||
if (krbLastPwdChange) slapi_ch_free_string(&krbLastPwdChange);
|
||||
if (fqdn) slapi_ch_free_string(&fqdn);
|
||||
if (sdn) slapi_sdn_free(&sdn);
|
||||
|
||||
LOG("%s", errMesg ? errMesg : "success\n");
|
||||
slapi_send_ldap_result(pb, rc, NULL, errMesg, 0, NULL);
|
||||
|
||||
Reference in New Issue
Block a user