commit e345eea1d16843b8d5feaf6a7378bb11cd649e30
parent b4b2708444516520cf4dae3035f5b912b669b000
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);