mirror of
git://erdgeist.org/opentracker
synced 2025-01-14 00:40:09 +00:00
Must not dealloc mmaped buffers with free()
This commit is contained in:
parent
d25cf9307e
commit
f56e40c24e
@ -144,8 +144,10 @@ static void sendmmapdata( const int64 s, char *buffer, size_t size ) {
|
||||
size_t header_size;
|
||||
tai6464 t;
|
||||
|
||||
if( !h )
|
||||
return free( buffer );
|
||||
if( !h ) {
|
||||
munmap( buffer, size );
|
||||
return;
|
||||
}
|
||||
if( h->flag & STRUCT_HTTP_FLAG_ARRAY_USED ) {
|
||||
h->flag &= ~STRUCT_HTTP_FLAG_ARRAY_USED;
|
||||
array_reset( &h->request );
|
||||
@ -153,7 +155,7 @@ static void sendmmapdata( const int64 s, char *buffer, size_t size ) {
|
||||
|
||||
header = malloc( SUCCESS_HTTP_HEADER_LENGTH );
|
||||
if( !header ) {
|
||||
free( buffer );
|
||||
munmap( buffer, size );
|
||||
HTTPERROR_500;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user