Skip to content
Snippets Groups Projects
Commit f69306c8 authored by Pierangelo Masarati's avatar Pierangelo Masarati
Browse files

fix previous commit (may be called more than once)

parent 1b0c4f5a
No related branches found
No related tags found
No related merge requests found
......@@ -537,9 +537,10 @@ tool_args( int argc, char **argv )
}
tmpctrls = (LDAPControl *)realloc( unknown_ctrls,
(unknown_ctrls_num + 2)*sizeof( LDAPControl ) );
(unknown_ctrls_num + 1)*sizeof( LDAPControl ) );
if ( tmpctrls == NULL ) {
fprintf( stderr, "%s: no memory?\n", prog );
exit( EXIT_FAILURE );
}
unknown_ctrls = tmpctrls;
ctrl.ldctl_oid = control;
......@@ -1594,8 +1595,7 @@ tool_server_controls( LDAP *ld, LDAPControl *extra_c, int count )
while ( count-- ) {
ctrls[i++] = extra_c++;
}
count = 0;
while ( unknown_ctrls_num-- ) {
for ( count = 0; count < unknown_ctrls_num; count++ ) {
ctrls[i++] = &unknown_ctrls[count++];
}
ctrls[i] = NULL;
......
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