aboutsummaryrefslogtreecommitdiff
path: root/src/backend/libpq/auth.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/libpq/auth.c')
-rw-r--r--src/backend/libpq/auth.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/backend/libpq/auth.c b/src/backend/libpq/auth.c
index b3e51698dcc..a776bc3ed7c 100644
--- a/src/backend/libpq/auth.c
+++ b/src/backend/libpq/auth.c
@@ -2568,6 +2568,7 @@ CheckLDAPAuth(Port *port)
else
filter = psprintf("(uid=%s)", port->user_name);
+ search_message = NULL;
r = ldap_search_s(ldap,
port->hba->ldapbasedn,
port->hba->ldapscope,
@@ -2582,6 +2583,8 @@ CheckLDAPAuth(Port *port)
(errmsg("could not search LDAP for filter \"%s\" on server \"%s\": %s",
filter, server_name, ldap_err2string(r)),
errdetail_for_ldap(ldap)));
+ if (search_message != NULL)
+ ldap_msgfree(search_message);
ldap_unbind(ldap);
pfree(passwd);
pfree(filter);