summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opentracker.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/opentracker.c b/opentracker.c
index 28ac071..c547007 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -144,8 +144,10 @@ static void sendmmapdata( const int64 s, char *buffer, size_t size ) {
144 size_t header_size; 144 size_t header_size;
145 tai6464 t; 145 tai6464 t;
146 146
147 if( !h ) 147 if( !h ) {
148 return free( buffer ); 148 munmap( buffer, size );
149 return;
150 }
149 if( h->flag & STRUCT_HTTP_FLAG_ARRAY_USED ) { 151 if( h->flag & STRUCT_HTTP_FLAG_ARRAY_USED ) {
150 h->flag &= ~STRUCT_HTTP_FLAG_ARRAY_USED; 152 h->flag &= ~STRUCT_HTTP_FLAG_ARRAY_USED;
151 array_reset( &h->request ); 153 array_reset( &h->request );
@@ -153,7 +155,7 @@ static void sendmmapdata( const int64 s, char *buffer, size_t size ) {
153 155
154 header = malloc( SUCCESS_HTTP_HEADER_LENGTH ); 156 header = malloc( SUCCESS_HTTP_HEADER_LENGTH );
155 if( !header ) { 157 if( !header ) {
156 free( buffer ); 158 munmap( buffer, size );
157 HTTPERROR_500; 159 HTTPERROR_500;
158 } 160 }
159 161