From: Pierangelo Masarati Date: Sat, 29 Dec 2007 17:59:28 +0000 (+0000) Subject: plug leak (ITS#5302) X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~260 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ac689156bcb22fdd468bbcf8a0b255ff93cc5f55;p=openldap plug leak (ITS#5302) --- diff --git a/servers/slapd/overlays/memberof.c b/servers/slapd/overlays/memberof.c index 3a5c6ac4c0..50d018d0dd 100644 --- a/servers/slapd/overlays/memberof.c +++ b/servers/slapd/overlays/memberof.c @@ -232,6 +232,14 @@ memberof_saved_member_set( Operation *op, void *keyp, BerVarray vals ) *key = saved_vals; } else { + BerVarray old_vals = NULL; + + ldap_pvt_thread_pool_getkey( op->o_threadctx, + key, (void **)&old_vals, NULL ); + if ( old_vals != NULL ) { + ber_bvarray_free( old_vals ); + } + ldap_pvt_thread_pool_setkey( op->o_threadctx, key, saved_vals, memberof_saved_member_free ); } @@ -1218,6 +1226,7 @@ memberof_res_delete( Operation *op, SlapReply *rs ) NULL, NULL ); } + memberof_saved_member_set( op, &saved_memberof_vals, NULL ); ber_bvarray_free( vals ); } @@ -1231,6 +1240,7 @@ memberof_res_delete( Operation *op, SlapReply *rs ) NULL, NULL ); } + memberof_saved_member_set( op, &saved_member_vals, NULL ); ber_bvarray_free( vals ); } }