diff --git a/src/libtdeldap.cpp b/src/libtdeldap.cpp
index 11b0150..1e2678c 100644
--- a/src/libtdeldap.cpp
+++ b/src/libtdeldap.cpp
@@ -317,10 +317,14 @@
}
}
}
- // 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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
}
}
- // clean up
+ // Clean up
ldap_msgfree(msg);
if (mretcode) *mretcode = 0;
@@ -2684,7 +2688,7 @@
}
}
- // clean up
+ // Clean up
ldap_msgfree(msg);
return realmCAMaster;
@@ -2763,7 +2767,7 @@
}
}
- // clean up
+ // Clean up
ldap_msgfree(msg);
return 0;
@@ -3048,7 +3052,7 @@
builtininfo = parseLDAPTDEBuiltinsRecord(entry);
}
- // clean up
+ // Clean up
ldap_msgfree(msg);
return builtininfo;
@@ -3084,7 +3088,7 @@
}
}
- // clean up
+ // Clean up
ldap_msgfree(msg);
// Set OpenLDAP defaults
@@ -3103,7 +3107,7 @@
replicationinfo = parseLDAPMasterReplicationRecord(replicationinfo, entry);
}
- // clean up
+ // Clean up
ldap_msgfree(msg);
return replicationinfo;
@@ -3428,8 +3432,8 @@
haveOlcOverlaySyncProv = true;
}
}
-
- // clean up
+
+ // Clean up
ldap_msgfree(msg);
if (!haveOlcOverlaySyncProv) {
@@ -3478,8 +3482,8 @@
haveOlcOverlaySyncProv = true;
}
}
-
- // clean up
+
+ // Clean up
ldap_msgfree(msg);
if (!haveOlcOverlaySyncProv) {
@@ -3591,7 +3595,7 @@
}
}
- // clean up
+ // Clean up
ldap_msgfree(msg);
return returncode;
|