Assert that pointer passed to jmem_pools_free is not NULL

If a NULL pointer is passed here, the list of free chunks gets lost.

JerryScript-DCO-1.0-Signed-off-by: Geoff Gustafson geoff@linux.intel.com
This commit is contained in:
Geoff Gustafson 2016-08-29 03:20:13 -07:00 committed by Akos Kiss
parent 8ea60072b3
commit 7c50dc1691

View File

@ -131,6 +131,8 @@ jmem_pools_alloc (void)
void __attribute__((hot))
jmem_pools_free (void *chunk_p) /**< pointer to the chunk */
{
JERRY_ASSERT (chunk_p != NULL);
jmem_pools_chunk_t *const chunk_to_free_p = (jmem_pools_chunk_t *) chunk_p;
VALGRIND_DEFINED_SPACE (chunk_to_free_p, JMEM_POOL_CHUNK_SIZE);