]> git.sur5r.net Git - openldap/commitdiff
ITS#7723 fix reference counting
authorJan Synacek <jsynacek@redhat.com>
Wed, 13 Nov 2013 08:06:54 +0000 (09:06 +0100)
committerHoward Chu <hyc@openldap.org>
Tue, 18 Mar 2014 10:38:11 +0000 (03:38 -0700)
libraries/librewrite/session.c

index fcc76987e92932d9bacb8ff3d9937904b837cf53..02fc0540b33e2a18b011cbddf0d21a26a29c4b50 100644 (file)
@@ -161,6 +161,7 @@ rewrite_session_find(
 #ifdef USE_REWRITE_LDAP_PVT_THREADS
        if ( session ) {
                ldap_pvt_thread_mutex_lock( &session->ls_mutex );
+               session->ls_count++;
        }
        ldap_pvt_thread_rdwr_runlock( &info->li_cookies_mutex );
 #endif /* USE_REWRITE_LDAP_PVT_THREADS */
@@ -178,6 +179,7 @@ rewrite_session_return(
 )
 {
        assert( session != NULL );
+       session->ls_count--;
        ldap_pvt_thread_mutex_unlock( &session->ls_mutex );
 }