From: Howard Chu Date: Thu, 27 Sep 2007 19:20:04 +0000 (+0000) Subject: Init/destroy mutex X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~588 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6db8d0d1b5bff8e3a0221b06913f3aa44ce9239d;p=openldap Init/destroy mutex --- 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; }