[Webkit-unassigned] [Bug 65408] [EFL] Add "return" statement corresponding to abnormal condition on _ewk_frame_smart_add.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 19 05:29:00 PDT 2011


--- Comment #12 from Adam Roben (:aroben) <aroben at apple.com>  2011-08-19 05:28:59 PST ---
(From update of attachment 102427)
View in context: https://bugs.webkit.org/attachment.cgi?id=102427&action=review

> Source/WebKit/efl/ChangeLog:8
> +        In order to avoid abnormal reference of variable "sd",
> +        it must be returned if it can't be allocated because variable "sd" can be referenced
> +        regardless of success of allocation.

I think this could be stated a little more clearly. Something like:

Bail out when we fail to allocate an Ewk_Frame_Smart_Data object rather than continuing on as if the allocation had succeeded.

> Source/WebKit/efl/ewk/ewk_frame.cpp:184
>          sd = (Ewk_Frame_Smart_Data*)calloc(1, sizeof(Ewk_Frame_Smart_Data));
> -        if (!sd)
> +        if (!sd) {
>              CRITICAL("could not allocate Ewk_Frame_Smart_Data");
> -        else
> -            evas_object_smart_data_set(o, sd);
> +            return;
> +        }

Is this really a condition we expect to occur? Will we really continue to function correctly even if we return early from this function? We don't check for allocation failures in most of WebKit/WebCore, so I assume that if we're really in an out-of-memory situation we'll just crash a little later.

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