[Webkit-unassigned] [Bug 72017] [EFL] Add NULL checks after memory allocation
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Tue Dec 6 08:02:50 PST 2011
https://bugs.webkit.org/show_bug.cgi?id=72017
--- Comment #10 from Raphael Kubo da Costa <kubo at profusion.mobi> 2011-12-06 08:02:50 PST ---
(In reply to comment #9)
> (In reply to comment #8)
> > > Source/WebKit/efl/ewk/ewk_cookies.cpp:104
> > > + } else
> > > + CRITICAL("Could not allocate Ewk_Cookie.");
> >
> > I still wonder if this is really needed. Assuming the hypothetical case in which malloc fails in the middle of the loop, you nonetheless continue trying to allocate other Ewk_Cookies to add them to the list and then return. I don't think this helps the caller all that much.
>
> Do you prefer to stop loop in case of malloc failure and destroy (by free()) allocated memory?
Well, I'm generally against the idea of checking all those allocations :) You will end up doing a lot more work for a hypothetical situation in which you are already pretty much screwed up.
> A similar solution in used in ewk_frame_source_get().
Sorry, I couldn't find similar code in that function.
--
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