From 3d075186bf866fa461eef987e0b06652b6ca356e Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 7 Aug 2005 21:26:15 +0000 Subject: [PATCH] don't leak entry/referrals in case of reference --- servers/slapd/back-sql/search.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/servers/slapd/back-sql/search.c b/servers/slapd/back-sql/search.c index d272ef724f..44b0617772 100644 --- a/servers/slapd/back-sql/search.c +++ b/servers/slapd/back-sql/search.c @@ -1843,6 +1843,10 @@ backsql_search( Operation *op, SlapReply *rs ) } break; } + + /* an entry was created; free it */ + entry_clean( bsi.bsi_e ); + /* fall thru */ default: @@ -1863,8 +1867,13 @@ backsql_search( Operation *op, SlapReply *rs ) #endif /* SLAP_ACL_HONOR_DISCLOSE */ send_ldap_result( op, rs ); - goto done; + if ( rs->sr_ref ) { + ber_bvarray_free( rs->sr_ref ); + rs->sr_ref = NULL; + } + + goto done; } #ifdef SLAP_ACL_HONOR_DISCLOSE /* NOTE: __NEW__ "search" access is required -- 2.39.5