From 922a7e44883aaf77556885dfa3a413e11c0ec6e8 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Wed, 14 Jul 2004 01:10:35 +0000 Subject: [PATCH] cleanup; plug potential leak? --- servers/slapd/result.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/servers/slapd/result.c b/servers/slapd/result.c index b7c71a8a9b..4e6cf7a77d 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -746,7 +746,7 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) { BerElementBuffer berbuf; BerElement *ber = (BerElement *) &berbuf; - Attribute *a, *aa; + Attribute *a, *aa = NULL; int i, j, rc=-1, bytes; char *edn; int userattrs; @@ -1196,7 +1196,6 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, "encoding description error" ); - attrs_free( aa ); goto error_return; } @@ -1238,7 +1237,6 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, "encoding values error" ); - attrs_free( aa ); goto error_return; } } @@ -1257,7 +1255,6 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) if ( op->o_res_ber == NULL ) ber_free_buf( ber ); send_ldap_error( op, rs, LDAP_OTHER, "encode end error" ); - attrs_free( aa ); goto error_return; } } @@ -1308,7 +1305,6 @@ slap_send_search_entry( Operation *op, SlapReply *rs ) e_flags = NULL; } - attrs_free( aa ); rc = ber_printf( ber, /*{{*/ "}N}" ); if( rc != -1 ) { @@ -1388,6 +1384,10 @@ error_return:; slap_sl_free( e_flags, op->o_tmpmemctx ); } + if ( aa ) { + attrs_free( aa ); + } + if ( op->o_callback ) { slap_callback *sc = op->o_callback, *sc_next = op->o_callback; -- 2.39.5