eina: prevent NULL offsetting.
authorcedric <cedric>
Mon, 11 Apr 2011 17:28:16 +0000 (17:28 +0000)
committercedric <cedric@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 11 Apr 2011 17:28:16 +0000 (17:28 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/eina@58560 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/modules/mp/chained_pool/eina_chained_mempool.c

index 5457b52..160530a 100644 (file)
@@ -262,7 +262,7 @@ eina_chained_mempool_malloc(void *data, __UNUSED__ unsigned int size)
 #endif
 
    // Either we have some free space in the first one, or there is no free space.
-   p = EINA_INLIST_CONTAINER_GET(pool->first, Chained_Pool);
+   if (pool->first) p = EINA_INLIST_CONTAINER_GET(pool->first, Chained_Pool);
 
    // base is not NULL - has a free slot
    if (p && !p->base && !p->last)