]> git.sur5r.net Git - openldap/commitdiff
Init/destroy mutex
authorHoward Chu <hyc@openldap.org>
Thu, 27 Sep 2007 19:20:04 +0000 (19:20 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 27 Sep 2007 19:20:04 +0000 (19:20 +0000)
contrib/slapd-modules/usn/usn.c

index c1020278802212f3b14d3a3607bcea172d07f44c..1b6dd8d7663b39156f950bfd5995cae33444e2d0 100644 (file)
@@ -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;
 }