]> git.sur5r.net Git - openldap/commitdiff
Plug one-time LDAPMessage leak
authorHallvard Furuseth <hallvard@openldap.org>
Mon, 20 Dec 2010 12:39:48 +0000 (12:39 +0000)
committerHallvard Furuseth <hallvard@openldap.org>
Mon, 20 Dec 2010 12:39:48 +0000 (12:39 +0000)
clients/tools/ldapexop.c

index 095d5e337669bc82d1bde190527464e17ba62afc..b259bef03cbab993b5c4eef9ff83e14955987682 100644 (file)
@@ -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();