jpeg pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=120305b08eb53cec419513d35c7e519a57c8e377

commit 120305b08eb53cec419513d35c7e519a57c8e377
Author: Anand <anand...@samsung.com>
Date:   Tue Nov 24 17:50:09 2015 +0900

    eina: Applied NULL check
    
    Summary:
    In _eina_list_setup_accounting function
    {
    ...
    ...
    if (!list->accounting)
         goto on_error;
    ...
    ...
    on_error:
       _eina_list_mempool_list_free(list);
    }
    
    _eina_list_mempool_list_free function deference the "list->accounting"
    variable which is already NULL.
    
    Reviewers: JackDanielZ, jpeg
    
    Reviewed By: jpeg
    
    Subscribers: cedric, jpeg
    
    Differential Revision: https://phab.enlightenment.org/D3376
---
 src/lib/eina/eina_list.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/lib/eina/eina_list.c b/src/lib/eina/eina_list.c
index 6a73243..5c926ea 100644
--- a/src/lib/eina/eina_list.c
+++ b/src/lib/eina/eina_list.c
@@ -209,9 +209,12 @@ _eina_list_mempool_list_free(Eina_List *list)
 {
    EINA_MAGIC_CHECK_LIST(list);
 
-   list->accounting->count--;
-   if (list->accounting->count == 0)
-     _eina_list_mempool_accounting_free(list->accounting);
+   if (list->accounting)
+     {
+        list->accounting->count--;
+        if (list->accounting->count == 0)
+          _eina_list_mempool_accounting_free(list->accounting);
+     }
 
    EINA_MAGIC_SET(list, EINA_MAGIC_NONE);
    eina_mempool_free(_eina_list_mp, list);

-- 


Reply via email to