]> git.sur5r.net Git - openldap/commitdiff
make sure msg is freed
authorPierangelo Masarati <ando@openldap.org>
Sat, 8 Jan 2011 12:49:21 +0000 (12:49 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 8 Jan 2011 12:49:21 +0000 (12:49 +0000)
clients/tools/ldapwhoami.c

index b8d8f3718be01ad3f6b85e215f58408afb918cb4..12be137f4ba2f6469e1d30a1972879347b30604d 100644 (file)
@@ -182,7 +182,6 @@ main( int argc, char *argv[] )
        }
 
        rc = ldap_parse_whoami( ld, res, &authzid );
-       ldap_msgfree(res);
 
        if( rc != LDAP_SUCCESS ) {
                tool_perror( "ldap_parse_whoami", rc, NULL, NULL, NULL, NULL );
@@ -199,6 +198,7 @@ main( int argc, char *argv[] )
        }
 
 skip:
+       ldap_msgfree(res);
        if ( verbose || ( code != LDAP_SUCCESS ) ||
                matcheddn || text || refs || ctrls )
        {