mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Fix CID 11022: Resource leak
https://fedorahosted.org/freeipa/ticket/2037
This commit is contained in:
@@ -1571,6 +1571,7 @@ static krb5_error_code ipadb_entry_to_mods(krb5_context kcontext,
|
||||
char **new_history;
|
||||
int nh_len;
|
||||
int ret;
|
||||
int i;
|
||||
|
||||
ied = (struct ipadb_e_data *)entry->e_data;
|
||||
if (ied->magic != IPA_E_DATA_MAGIC) {
|
||||
@@ -1619,6 +1620,12 @@ static krb5_error_code ipadb_entry_to_mods(krb5_context kcontext,
|
||||
|
||||
kerr = ipadb_get_ldap_mod_str_list(imods, "passwordHistory",
|
||||
new_history, nh_len, mod_op);
|
||||
|
||||
for (i = 0; i < nh_len; i++) {
|
||||
free(new_history[i]);
|
||||
}
|
||||
free(new_history);
|
||||
|
||||
if (kerr) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user