mirror of
git://erdgeist.org/opentracker
synced 2025-01-14 17:00:07 +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;
|
size_t header_size;
|
||||||
tai6464 t;
|
tai6464 t;
|
||||||
|
|
||||||
if( !h )
|
if( !h ) {
|
||||||
return free( buffer );
|
munmap( buffer, size );
|
||||||
|
return;
|
||||||
|
}
|
||||||
if( h->flag & STRUCT_HTTP_FLAG_ARRAY_USED ) {
|
if( h->flag & STRUCT_HTTP_FLAG_ARRAY_USED ) {
|
||||||
h->flag &= ~STRUCT_HTTP_FLAG_ARRAY_USED;
|
h->flag &= ~STRUCT_HTTP_FLAG_ARRAY_USED;
|
||||||
array_reset( &h->request );
|
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 );
|
header = malloc( SUCCESS_HTTP_HEADER_LENGTH );
|
||||||
if( !header ) {
|
if( !header ) {
|
||||||
free( buffer );
|
munmap( buffer, size );
|
||||||
HTTPERROR_500;
|
HTTPERROR_500;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user