From 8f64cb135f36a723165d750a24008c773e8282f5 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 27 Nov 2004 16:05:49 +0000 Subject: [PATCH] Fix syncprov_db_close, only cleanup thrctx once --- servers/slapd/overlays/syncprov.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 7cd42efb29..69fccdeb5e 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -1587,11 +1587,12 @@ syncprov_db_config( typedef struct thread_keys { void *key; void *data; - ldap_pvt_thread_pool_keyfree_t *free; + ldap_pvt_thread_pool_keyfree_t *xfree; } thread_keys; +#define MAXKEYS 32 /* A fake thread context */ -static thread_keys thrctx[8]; +static thread_keys thrctx[MAXKEYS]; /* Read any existing contextCSN from the underlying db. * Then search for any entries newer than that. If no value exists, @@ -1663,8 +1664,9 @@ syncprov_db_close( syncprov_checkpoint( op, &rs, on ); } for ( i=0; thrctx[i].key; i++) { - if ( thrctx[i].free ) - thrctx[i].free( thrctx[i].key, thrctx[i].data ); + if ( thrctx[i].xfree ) + thrctx[i].xfree( thrctx[i].key, thrctx[i].data ); + thrctx[i].key = NULL; } return 0; -- 2.39.5