mirror of
git://erdgeist.org/opentracker
synced 2025-01-11 15:30:07 +00:00
Forgot to unlock bucket in case of malloc error, thanks to Astro for reporting.
This commit is contained in:
parent
0cfd1e575d
commit
d9ed6c22bd
@ -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 ];
|
uint32_t *count = counts[ s24 >> NUM_LOWBITS ];
|
||||||
if( !count ) {
|
if( !count ) {
|
||||||
count = malloc( sizeof(uint32_t) * NUM_S24S );
|
count = malloc( sizeof(uint32_t) * NUM_S24S );
|
||||||
if( !count )
|
if( !count ) {
|
||||||
|
mutex_bucket_unlock( bucket );
|
||||||
goto bailout_cleanup;
|
goto bailout_cleanup;
|
||||||
|
}
|
||||||
byte_zero( count, sizeof( uint32_t ) * NUM_S24S );
|
byte_zero( count, sizeof( uint32_t ) * NUM_S24S );
|
||||||
counts[ s24 >> NUM_LOWBITS ] = count;
|
counts[ s24 >> NUM_LOWBITS ] = count;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user