Fix memory leak on bind failure

Fix minor issues with comments
(cherry picked from commit 3fdd5c964a)
r14.0.x r14.0.3
Timothy Pearson 9 years ago committed by Slávek Banko
parent ba81541fe5
commit f746c03828

@ -317,12 +317,16 @@ int LDAPManager::bind(TQString* errstr) {
}
}
}
// clean up
// Clean up
ldap_msgfree(msg);
// All done!
ldap_unbind_ext_s(ldapconn, NULL, NULL);
}
else {
// Clean up
ldap_unbind_ext_s(ldapconn, NULL, NULL);
}
}
}
@ -654,8 +658,8 @@ LDAPUserInfoList LDAPManager::users(int* mretcode, TQString *errstr) {
for(entry = ldap_first_entry(m_ldap, msg); entry != NULL; entry = ldap_next_entry(m_ldap, entry)) {
users.append(parseLDAPUserRecord(entry));
}
// clean up
// Clean up
ldap_msgfree(msg);
if (mretcode) *mretcode = 0;
@ -732,8 +736,8 @@ LDAPUserInfoList LDAPManager::users(int* mretcode, TQString *errstr) {
for(entry = ldap_first_entry(m_ldap, msg); entry != NULL; entry = ldap_next_entry(m_ldap, entry)) {
users.append(parseLDAPUserRecord(entry));
}
// clean up
// Clean up
ldap_msgfree(msg);
} while (morePages);
@ -765,8 +769,8 @@ LDAPUserInfo LDAPManager::getUserByDistinguishedName(TQString dn) {
for(entry = ldap_first_entry(m_ldap, msg); entry != NULL; entry = ldap_next_entry(m_ldap, entry)) {
userinfo = parseLDAPUserRecord(entry);
}
// clean up
// Clean up
ldap_msgfree(msg);
return userinfo;
@ -796,8 +800,8 @@ LDAPGroupInfo LDAPManager::getGroupByDistinguishedName(TQString dn, TQString *er
for(entry = ldap_first_entry(m_ldap, msg); entry != NULL; entry = ldap_next_entry(m_ldap, entry)) {
groupinfo = parseLDAPGroupRecord(entry);
}
// clean up
// Clean up
ldap_msgfree(msg);
return groupinfo;
@ -2204,8 +2208,8 @@ LDAPGroupInfoList LDAPManager::groups(int* mretcode, TQString *errstr) {
for(entry = ldap_first_entry(m_ldap, msg); entry != NULL; entry = ldap_next_entry(m_ldap, entry)) {
groups.append(parseLDAPGroupRecord(entry));
}
// clean up
// Clean up
ldap_msgfree(msg);
if (mretcode) *mretcode = 0;
@ -2282,8 +2286,8 @@ LDAPGroupInfoList LDAPManager::groups(int* mretcode, TQString *errstr) {
for(entry = ldap_first_entry(m_ldap, msg); entry != NULL; entry = ldap_next_entry(m_ldap, entry)) {
groups.append(parseLDAPGroupRecord(entry));
}
// clean up
// Clean up
ldap_msgfree(msg);
} while (morePages);
@ -2325,8 +2329,8 @@ LDAPMachineInfoList LDAPManager::machines(int* mretcode, TQString *errstr) {
for(entry = ldap_first_entry(m_ldap, msg); entry != NULL; entry = ldap_next_entry(m_ldap, entry)) {
machines.append(parseLDAPMachineRecord(entry));
}
// clean up
// Clean up
ldap_msgfree(msg);
if (mretcode) *mretcode = 0;
@ -2403,8 +2407,8 @@ LDAPMachineInfoList LDAPManager::machines(int* mretcode, TQString *errstr) {
for(entry = ldap_first_entry(m_ldap, msg); entry != NULL; entry = ldap_next_entry(m_ldap, entry)) {
machines.append(parseLDAPMachineRecord(entry));
}
// clean up
// Clean up
ldap_msgfree(msg);
} while (morePages);
@ -2486,7 +2490,7 @@ LDAPServiceInfoList LDAPManager::machineServices(TQString machine_dn, int* mretc
}
}
// clean up
// Clean up
ldap_msgfree(msg);
if (mretcode) *mretcode = 0;
@ -2684,7 +2688,7 @@ TQString LDAPManager::getRealmCAMaster(TQString* errstr) {
}
}
// clean up
// Clean up
ldap_msgfree(msg);
return realmCAMaster;
@ -2763,7 +2767,7 @@ int LDAPManager::moveKerberosEntries(TQString newSuffix, TQString* errstr) {
}
}
// clean up
// Clean up
ldap_msgfree(msg);
return 0;
@ -3048,7 +3052,7 @@ LDAPTDEBuiltinsInfo LDAPManager::getTDEBuiltinMappings(TQString *errstr) {
builtininfo = parseLDAPTDEBuiltinsRecord(entry);
}
// clean up
// Clean up
ldap_msgfree(msg);
return builtininfo;
@ -3084,7 +3088,7 @@ LDAPMasterReplicationInfo LDAPManager::getLDAPMasterReplicationSettings(TQString
}
}
// clean up
// Clean up
ldap_msgfree(msg);
// Set OpenLDAP defaults
@ -3103,7 +3107,7 @@ LDAPMasterReplicationInfo LDAPManager::getLDAPMasterReplicationSettings(TQString
replicationinfo = parseLDAPMasterReplicationRecord(replicationinfo, entry);
}
// clean up
// Clean up
ldap_msgfree(msg);
return replicationinfo;
@ -3428,8 +3432,8 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
haveOlcOverlaySyncProv = true;
}
}
// clean up
// Clean up
ldap_msgfree(msg);
if (!haveOlcOverlaySyncProv) {
@ -3478,8 +3482,8 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
haveOlcOverlaySyncProv = true;
}
}
// clean up
// Clean up
ldap_msgfree(msg);
if (!haveOlcOverlaySyncProv) {
@ -3591,7 +3595,7 @@ int LDAPManager::getTDECertificate(TQString certificateName, TQString fileName,
}
}
// clean up
// Clean up
ldap_msgfree(msg);
return returncode;

Loading…
Cancel
Save