From: Pierangelo Masarati Date: Sun, 7 Aug 2005 21:26:15 +0000 (+0000) Subject: don't leak entry/referrals in case of reference X-Git-Tag: OPENLDAP_AC_BP~61 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3d075186bf866fa461eef987e0b06652b6ca356e;p=openldap don't leak entry/referrals in case of reference --- 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