[Webkit-unassigned] [Bug 61423] [EFL] Eina_List out of memory handling

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed May 25 08:00:07 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=61423


Raphael Kubo da Costa <kubo at profusion.mobi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kubo at profusion.mobi




--- Comment #4 from Raphael Kubo da Costa <kubo at profusion.mobi>  2011-05-25 08:00:07 PST ---
Informal r- from my side: in case the OOM handler is called, the memory still won't be properly freed. As the kind of destruction calls varies depending on what kind of data you are freeing, the macro may end up looking ugly enough not to have its existence justified. IMO, these checks could be done in-place in each file, or you can just ignore the eina_list_append errors, which is done 99% of the time in EFL code.

> Source/WebKit/efl/ewk/ewk_contextmenu.cpp:411
> +    EINA_LIST_OUT_OF_MEMORY_HANDLING_AND_RETURN(o->items)

You are just calling free() on the pointer, but you still need to call ewk_context_menu_item_free in order not to leak the memory allocated in the items inside the struct.

> Source/WebKit/efl/ewk/ewk_cookies.cpp:120
> +        EINA_LIST_OUT_OF_MEMORY_HANDLING_AND_RETURN(el, 0)

You are just calling free() on the pointer, but you are not freeing the memory allocated for the data in the struct it points to.

> Source/WebKit/efl/ewk/ewk_history.cpp:108
> +            EINA_LIST_OUT_OF_MEMORY_HANDLING_AND_RETURN(ret, 0)

You are just calling free() on the pointer, but you are not freeing the memory allocated for the data (or de-ref'ing the data when necessary), which is done in _ewk_history_item_free().

> Source/WebKit/efl/ewk/ewk_private.h:49
> +#define EINA_LIST_OUT_OF_MEMORY_HANDLING_AND_RETURN(list, ...)          \

The macro name looks a bit misleading, as you are not necessarily out of memory when there is an error.

> Source/WebKit/efl/ewk/ewk_view.cpp:4119
> +        EINA_LIST_OUT_OF_MEMORY_HANDLING_AND_RETURN(priv->popup.menu.items)

The same comment I made to your changes to ewk_contextmenu.cpp applies here.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list