From d9ed6c22bd26268b8ae51cc062e41f20e2dc68bd Mon Sep 17 00:00:00 2001 From: erdgeist <> Date: Mon, 17 Dec 2007 18:55:38 +0000 Subject: Forgot to unlock bucket in case of malloc error, thanks to Astro for reporting. --- ot_stats.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'ot_stats.c') diff --git a/ot_stats.c b/ot_stats.c index d2b02fa..417e194 100644 --- a/ot_stats.c +++ b/ot_stats.c @@ -122,8 +122,10 @@ static size_t stats_slash24s_txt( char * reply, size_t amount, uint32_t thresh ) uint32_t *count = counts[ s24 >> NUM_LOWBITS ]; if( !count ) { count = malloc( sizeof(uint32_t) * NUM_S24S ); - if( !count ) + if( !count ) { + mutex_bucket_unlock( bucket ); goto bailout_cleanup; + } byte_zero( count, sizeof( uint32_t ) * NUM_S24S ); counts[ s24 >> NUM_LOWBITS ] = count; } -- cgit v1.2.3