summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2007-12-17 18:55:38 +0000
committererdgeist <>2007-12-17 18:55:38 +0000
commitd9ed6c22bd26268b8ae51cc062e41f20e2dc68bd (patch)
treef06bd9d4ff083c874f33bf46dd9cd4db98592738
parent0cfd1e575dae3a5705203b6b06b8a534a12ee652 (diff)
Forgot to unlock bucket in case of malloc error, thanks to Astro for reporting.
-rw-r--r--ot_stats.c4
1 files changed, 3 insertions, 1 deletions
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 )
122 uint32_t *count = counts[ s24 >> NUM_LOWBITS ]; 122 uint32_t *count = counts[ s24 >> NUM_LOWBITS ];
123 if( !count ) { 123 if( !count ) {
124 count = malloc( sizeof(uint32_t) * NUM_S24S ); 124 count = malloc( sizeof(uint32_t) * NUM_S24S );
125 if( !count ) 125 if( !count ) {
126 mutex_bucket_unlock( bucket );
126 goto bailout_cleanup; 127 goto bailout_cleanup;
128 }
127 byte_zero( count, sizeof( uint32_t ) * NUM_S24S ); 129 byte_zero( count, sizeof( uint32_t ) * NUM_S24S );
128 counts[ s24 >> NUM_LOWBITS ] = count; 130 counts[ s24 >> NUM_LOWBITS ] = count;
129 } 131 }