From: Kurt Zeilenga Date: Sat, 5 Dec 1998 02:43:01 +0000 (+0000) Subject: missing mutex unlock fix from rel eng 1.1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ffe99118d4a66198b671b5020433e51106c78b2;p=thirdparty%2Fopenldap.git missing mutex unlock fix from rel eng 1.1 --- diff --git a/servers/slurpd/replog.c b/servers/slurpd/replog.c index c3a855cffe..0305e65ad2 100644 --- a/servers/slurpd/replog.c +++ b/servers/slurpd/replog.c @@ -131,7 +131,7 @@ copy_replog( Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Can't lock replog \"%s\" for write: %s\n", src, sys_errlist[ errno ], 0 ); - lock_fclose( rfp ); + lock_fclose( rfp, lfp ); return( 1 ); } @@ -147,12 +147,12 @@ copy_replog( truncate( src, (off_t) 0 ); } - if ( lock_fclose( rfp, lfp ) == EOF ) { + if ( lock_fclose( dfp, dlfp ) == EOF ) { Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Error closing \"%s\"\n", src, 0, 0 ); } - if ( lock_fclose( dfp, dlfp ) == EOF ) { + if ( lock_fclose( rfp, lfp ) == EOF ) { Debug( LDAP_DEBUG_ANY, "Error: copy_replog: Error closing \"%s\"\n", src, 0, 0 ); diff --git a/servers/slurpd/st.c b/servers/slurpd/st.c index 610b295853..584d5e3728 100644 --- a/servers/slurpd/st.c +++ b/servers/slurpd/st.c @@ -56,8 +56,7 @@ St_add( pthread_mutex_unlock( &(st->st_mutex )); return NULL; } - st->st_data[ ind ] = ( Stel * ) ch_malloc( st->st_data, - sizeof( Stel )); + st->st_data[ ind ] = ( Stel * ) ch_malloc( sizeof( Stel ) ); if ( st->st_data[ ind ] == NULL ) { pthread_mutex_unlock( &(st->st_mutex )); return NULL; @@ -186,6 +185,7 @@ St_read( return 0; } if (( rc = acquire_lock( sglob->slurpd_status_file, &fp, &lfp)) < 0 ) { + pthread_mutex_unlock( &(st->st_mutex )); return 0; } while ( fgets( buf, sizeof( buf ), fp ) != NULL ) {