Skip to content
Snippets Groups Projects
Commit 76c5d2e0 authored by Quanah Gibson-Mount's avatar Quanah Gibson-Mount
Browse files

Fix one time memory leak

parent 14ba8394
No related branches found
No related tags found
No related merge requests found
......@@ -113,7 +113,7 @@ main( int argc, char *argv[] )
char *matcheddn = NULL, *text = NULL, **refs = NULL;
struct berval *authzid = NULL;
int id, code = 0;
LDAPMessage *res;
LDAPMessage *res = NULL;
LDAPControl **ctrls = NULL;
tool_init( TOOL_WHOAMI );
......@@ -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 )
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment