From 77a7ef0adf8889c90f7a3f8e7a4594445d87da3f Mon Sep 17 00:00:00 2001 From: Hallvard Furuseth Date: Mon, 20 Dec 2010 12:39:48 +0000 Subject: [PATCH] Plug one-time LDAPMessage leak --- clients/tools/ldapexop.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clients/tools/ldapexop.c b/clients/tools/ldapexop.c index 095d5e3376..b259bef03c 100644 --- a/clients/tools/ldapexop.c +++ b/clients/tools/ldapexop.c @@ -75,7 +75,7 @@ main( int argc, char *argv[] ) char *matcheddn = NULL, *text = NULL, **refs = NULL; LDAPControl **ctrls = NULL; int id, code; - LDAPMessage *res; + LDAPMessage *res = NULL; tool_init( TOOL_EXOP ); prog = lutil_progname( "ldapexop", argc, argv ); @@ -348,6 +348,8 @@ main( int argc, char *argv[] ) skip: /* disconnect from server */ + if ( res ) + ldap_msgfree( res ); tool_unbind( ld ); tool_destroy(); -- 2.39.5