mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2026-10-25 14:40:16 -05:00
ipa-graceperiod: fix memory leaks
Direct return of invalid grace limit bypassed cleanup code. `tmpstr` variable was not freed in all code paths. 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:
1 parent
f39acce911
commit
c173a70c85
1 file changed
+3
-1
@@ -448,7 +448,8 @@ static int ipagraceperiod_preop(Slapi_PBlock *pb)
|
||||
goto done;
|
||||
} else if (grace_limit < -1) {
|
||||
LOG_FATAL("Invalid passwordGraceLimit value %ld\n", grace_limit);
|
||||
return LDAP_OPERATIONS_ERROR;
|
||||
ret = LDAP_OPERATIONS_ERROR;
|
||||
goto done;
|
||||
}
|
||||
|
||||
grace_user_time = slapi_entry_attr_get_int(target_entry, "passwordGraceUserTime");
|
||||
@@ -500,6 +501,7 @@ done:
|
||||
slapi_vattr_values_free(&values, &actual_type_name, attr_free_flags);
|
||||
}
|
||||
if (sdn) slapi_sdn_free(&sdn);
|
||||
slapi_ch_free_string(&tmpstr);
|
||||
|
||||
LOG("preop returning %d: %s\n", ret, errstr ? errstr : "success\n");
|
||||
|
||||
|
||||
Reference in new issue
Block a user