diff options
author | Simo Sorce <ssorce@redhat.com> | 2011-11-03 13:21:59 -0400 |
---|---|---|
committer | Simo Sorce <ssorce@redhat.com> | 2012-01-11 12:04:15 -0500 |
commit | 82266c0d00a3c53eb782d6ca99a4872fa09b1b00 (patch) | |
tree | 706b077256a5390b21fa0658af4f209679bd93a6 /daemons | |
parent | 24a9cb6fc9392c1249923a8e339194877cc30df6 (diff) | |
download | freeipa.git-82266c0d00a3c53eb782d6ca99a4872fa09b1b00.tar.gz freeipa.git-82266c0d00a3c53eb782d6ca99a4872fa09b1b00.tar.xz freeipa.git-82266c0d00a3c53eb782d6ca99a4872fa09b1b00.zip |
Fix CID 11019: Resource leak
https://fedorahosted.org/freeipa/ticket/2037
Diffstat (limited to 'daemons')
-rw-r--r-- | daemons/ipa-kdb/ipa_kdb.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/daemons/ipa-kdb/ipa_kdb.c b/daemons/ipa-kdb/ipa_kdb.c index 6a6c2063..481b1f39 100644 --- a/daemons/ipa-kdb/ipa_kdb.c +++ b/daemons/ipa-kdb/ipa_kdb.c @@ -263,6 +263,13 @@ int ipadb_get_connection(struct ipadb_context *ipactx) done: ldap_msgfree(res); + + ldap_value_free_len(vals); + for (i = 0; i < c && cvals[i]; i++) { + free(cvals[i]); + } + free(cvals); + if (ret) { if (ipactx->lcontext) { ldap_unbind_ext_s(ipactx->lcontext, NULL, NULL); @@ -274,12 +281,6 @@ done: return EIO; } - ldap_value_free_len(vals); - for (i = 0; i < c; i++) { - free(cvals[i]); - } - free(cvals); - return 0; } |