Fixing memory leak in mem_pools_alloc.

This commit is contained in:
Ruben Ayrapetyan
2014-08-07 21:08:31 +04:00
parent 2887332573
commit d7e28e3a28
+4 -1
View File
@@ -181,8 +181,11 @@ mem_pools_alloc( mem_pool_chunk_type_t chunk_type) /**< chunk type */
if ( pool_space == NULL ) if ( pool_space == NULL )
{ {
/** /**
* Not enough memory. * Not enough memory. Freeing pool header that was allocated above.
*/ */
mem_pool_free_chunk( &mem_pool_for_pool_headers, (uint8_t*) pool_state);
return NULL; return NULL;
} }