From: Howard Chu Date: Sat, 18 Oct 2003 11:05:48 +0000 (+0000) Subject: Fix parse order in new print_entry ( ctrls ) X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~552 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7fd05f235cc3fc501bd44d4167bc6108b7e8c4ca;p=openldap Fix parse order in new print_entry ( ctrls ) --- diff --git a/clients/tools/ldapsearch.c b/clients/tools/ldapsearch.c index d2ded3e91a..1da32c7d85 100644 --- a/clients/tools/ldapsearch.c +++ b/clients/tools/ldapsearch.c @@ -1131,18 +1131,6 @@ print_entry( } write_ldif( LDIF_PUT_VALUE, "dn", bv.bv_val, bv.bv_len ); - rc = ldap_pvt_get_controls( ber, &ctrls ); - if( rc != LDAP_SUCCESS ) { - fprintf(stderr, _("print_entry: %d\n"), rc ); - ldap_perror( ld, "ldap_pvt_get_controls" ); - exit( EXIT_FAILURE ); - } - - if( ctrls ) { - print_ctrls( ctrls ); - ldap_controls_free( ctrls ); - } - if ( includeufn ) { if( ufn == NULL ) { ufn = ldap_dn2ufn( bv.bv_val ); @@ -1211,6 +1199,17 @@ print_entry( ber_memfree( bvals ); } } + rc = ldap_pvt_get_controls( ber, &ctrls ); + if( rc != LDAP_SUCCESS ) { + fprintf(stderr, _("print_entry: %d\n"), rc ); + ldap_perror( ld, "ldap_pvt_get_controls" ); + exit( EXIT_FAILURE ); + } + + if( ctrls ) { + print_ctrls( ctrls ); + ldap_controls_free( ctrls ); + } if( ber != NULL ) { ber_free( ber, 0 );