Fix memory leak on bind failure

Fix minor issues with comments
pull/1/head
Timothy Pearson 9 years ago
parent 3991980d35
commit 3fdd5c964a

@ -407,12 +407,16 @@ int LDAPManager::bind(TQString* errstr) {
} }
} }
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
// All done! // All done!
ldap_unbind_ext_s(ldapconn, NULL, NULL); ldap_unbind_ext_s(ldapconn, NULL, NULL);
} }
else {
// Clean up
ldap_unbind_ext_s(ldapconn, NULL, NULL);
}
} }
} }
@ -765,7 +769,7 @@ LDAPUserInfoList LDAPManager::users(int* mretcode, TQString *errstr) {
users.append(parseLDAPUserRecord(entry)); users.append(parseLDAPUserRecord(entry));
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
if (mretcode) *mretcode = 0; if (mretcode) *mretcode = 0;
@ -843,7 +847,7 @@ LDAPUserInfoList LDAPManager::users(int* mretcode, TQString *errstr) {
users.append(parseLDAPUserRecord(entry)); users.append(parseLDAPUserRecord(entry));
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
} while (morePages); } while (morePages);
@ -876,7 +880,7 @@ LDAPUserInfo LDAPManager::getUserByDistinguishedName(TQString dn) {
userinfo = parseLDAPUserRecord(entry); userinfo = parseLDAPUserRecord(entry);
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
return userinfo; return userinfo;
@ -907,7 +911,7 @@ LDAPGroupInfo LDAPManager::getGroupByDistinguishedName(TQString dn, TQString *er
groupinfo = parseLDAPGroupRecord(entry); groupinfo = parseLDAPGroupRecord(entry);
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
return groupinfo; return groupinfo;
@ -2513,7 +2517,7 @@ LDAPGroupInfoList LDAPManager::groups(int* mretcode, TQString *errstr) {
groups.append(parseLDAPGroupRecord(entry)); groups.append(parseLDAPGroupRecord(entry));
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
if (mretcode) *mretcode = 0; if (mretcode) *mretcode = 0;
@ -2591,7 +2595,7 @@ LDAPGroupInfoList LDAPManager::groups(int* mretcode, TQString *errstr) {
groups.append(parseLDAPGroupRecord(entry)); groups.append(parseLDAPGroupRecord(entry));
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
} while (morePages); } while (morePages);
@ -2634,7 +2638,7 @@ LDAPMachineInfoList LDAPManager::machines(int* mretcode, TQString *errstr) {
machines.append(parseLDAPMachineRecord(entry)); machines.append(parseLDAPMachineRecord(entry));
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
if (mretcode) *mretcode = 0; if (mretcode) *mretcode = 0;
@ -2712,7 +2716,7 @@ LDAPMachineInfoList LDAPManager::machines(int* mretcode, TQString *errstr) {
machines.append(parseLDAPMachineRecord(entry)); machines.append(parseLDAPMachineRecord(entry));
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
} while (morePages); } while (morePages);
@ -2794,7 +2798,7 @@ LDAPServiceInfoList LDAPManager::machineServices(TQString machine_dn, int* mretc
} }
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
if (mretcode) *mretcode = 0; if (mretcode) *mretcode = 0;
@ -3088,7 +3092,7 @@ TQString LDAPManager::getRealmCAMaster(TQString* errstr) {
} }
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
return realmCAMaster; return realmCAMaster;
@ -3191,7 +3195,7 @@ int LDAPManager::getLdapCertificateStoreAttribute(TQString attribute, TQString*
} }
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
return returncode; return returncode;
@ -3272,7 +3276,7 @@ int LDAPManager::moveKerberosEntries(TQString newSuffix, TQString* errstr) {
} }
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
return 0; return 0;
@ -3557,7 +3561,7 @@ LDAPTDEBuiltinsInfo LDAPManager::getTDEBuiltinMappings(TQString *errstr) {
builtininfo = parseLDAPTDEBuiltinsRecord(entry); builtininfo = parseLDAPTDEBuiltinsRecord(entry);
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
return builtininfo; return builtininfo;
@ -3593,7 +3597,7 @@ LDAPMasterReplicationInfo LDAPManager::getLDAPMasterReplicationSettings(TQString
} }
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
// Set OpenLDAP defaults // Set OpenLDAP defaults
@ -3612,7 +3616,7 @@ LDAPMasterReplicationInfo LDAPManager::getLDAPMasterReplicationSettings(TQString
replicationinfo = parseLDAPMasterReplicationRecord(replicationinfo, entry); replicationinfo = parseLDAPMasterReplicationRecord(replicationinfo, entry);
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
return replicationinfo; return replicationinfo;
@ -3938,7 +3942,7 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
} }
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
if (!haveOlcOverlaySyncProv) { if (!haveOlcOverlaySyncProv) {
@ -3988,7 +3992,7 @@ int LDAPManager::setLDAPMasterReplicationSettings(LDAPMasterReplicationInfo repl
} }
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
if (!haveOlcOverlaySyncProv) { if (!haveOlcOverlaySyncProv) {
@ -4097,7 +4101,7 @@ int LDAPManager::getTDECertificate(TQString certificateName, TQByteArray *certif
} }
} }
// clean up // Clean up
ldap_msgfree(msg); ldap_msgfree(msg);
return returncode; return returncode;

Loading…
Cancel
Save