commit 254f6308d5edc403b3641f0afa9cf39c3169a64f
parent 4aab5e4039d6421e36a6ff57fcc8402a23f21c79
Author: wwp <subscript@free.fr>
Date: Tue, 5 Oct 2021 09:42:04 +0200
Fix CID 1491221: resource leak.
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ldaputil.c b/src/ldaputil.c
@@ -243,7 +243,7 @@ GList *ldaputil_read_basedn(
{
GList *baseDN = NULL;
LDAP *ld = NULL;
- LdapControl *ctl = ldapctl_create();
+ LdapControl *ctl;
gint rc;
if( host == NULL )
@@ -251,6 +251,7 @@ GList *ldaputil_read_basedn(
if( port < 1 )
return NULL;
+ ctl = ldapctl_create();
ldapctl_set_tls(ctl, tls);
ldapctl_set_ssl(ctl, ssl);
ldapctl_set_port(ctl, port);