From 6db8d0d1b5bff8e3a0221b06913f3aa44ce9239d Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 27 Sep 2007 19:20:04 +0000 Subject: [PATCH] Init/destroy mutex --- contrib/slapd-modules/usn/usn.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/slapd-modules/usn/usn.c b/contrib/slapd-modules/usn/usn.c index c102027880..1b6dd8d766 100644 --- a/contrib/slapd-modules/usn/usn.c +++ b/contrib/slapd-modules/usn/usn.c @@ -213,6 +213,7 @@ usn_db_init( } ui = ch_calloc(1, sizeof(usn_info_t)); + ldap_pvt_thread_mutex_init( &ui->ui_mutex ); on->on_bi.bi_private = ui; return 0; } @@ -278,7 +279,11 @@ usn_db_destroy( ) { slap_overinst *on = (slap_overinst *)be->bd_info; - ch_free( on->on_bi.bi_private ); + usn_info_t *ui = on->on_bi.bi_private; + + ldap_pvt_thread_mutex_destroy( &ui->ui_mutex ); + ch_free( ui ); + on->on_bi.bi_private = NULL; return 0; } -- 2.39.5