diff options
author | Simo Sorce <ssorce@redhat.com> | 2011-11-03 13:45:06 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2011-11-07 11:13:55 -0500 |
commit | a49cf51ee254440610d26e30dfb306b3108bb1cd (patch) | |
tree | 8937fa1a3408ac0e8b8f8c9f349e4a75ce1fd6c5 /daemons/ipa-kdb | |
parent | c8aec450bef6cd24589476f7747bf37bf0e636ea (diff) | |
download | freeipa-a49cf51ee254440610d26e30dfb306b3108bb1cd.tar.gz freeipa-a49cf51ee254440610d26e30dfb306b3108bb1cd.tar.xz freeipa-a49cf51ee254440610d26e30dfb306b3108bb1cd.zip |
Fix CID 11022: Resource leak
https://fedorahosted.org/freeipa/ticket/2037
Diffstat (limited to 'daemons/ipa-kdb')
-rw-r--r-- | daemons/ipa-kdb/ipa_kdb_principals.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/daemons/ipa-kdb/ipa_kdb_principals.c b/daemons/ipa-kdb/ipa_kdb_principals.c index fdd834f35..117eea869 100644 --- a/daemons/ipa-kdb/ipa_kdb_principals.c +++ b/daemons/ipa-kdb/ipa_kdb_principals.c @@ -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; } |