diff options
author | erdgeist <> | 2007-12-17 18:55:38 +0000 |
---|---|---|
committer | erdgeist <> | 2007-12-17 18:55:38 +0000 |
commit | d9ed6c22bd26268b8ae51cc062e41f20e2dc68bd (patch) | |
tree | f06bd9d4ff083c874f33bf46dd9cd4db98592738 /ot_stats.c | |
parent | 0cfd1e575dae3a5705203b6b06b8a534a12ee652 (diff) |
Forgot to unlock bucket in case of malloc error, thanks to Astro for reporting.
Diffstat (limited to 'ot_stats.c')
-rw-r--r-- | ot_stats.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 | } |