From ac689156bcb22fdd468bbcf8a0b255ff93cc5f55 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 29 Dec 2007 17:59:28 +0000 Subject: [PATCH] plug leak (ITS#5302) --- servers/slapd/overlays/memberof.c | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 ); } } -- 2.39.5