[PATCH][weston] ivi-shell: initialize all fields in create_layout_transition

Bryce Harrington bryce at osg.samsung.com
Tue Sep 22 18:12:59 PDT 2015


On Mon, Sep 21, 2015 at 09:33:29AM -0700, Bill Spitzak wrote:
> On Sat, Sep 19, 2015 at 5:47 PM, John-John Tedro <johnjohn.tedro at gmail.com>
> wrote:
> 
> > create_layout_transition does not initialize is_transition_func.
> >
> > This patch initializes it to NULL.
> >
> > Signed-off-by: John-John Tedro <johnjohn.tedro at gmail.com>
> > ---
> >  ivi-shell/ivi-layout-transition.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/ivi-shell/ivi-layout-transition.c
> > b/ivi-shell/ivi-layout-transition.c
> > index d12a8f4..d45b332 100644
> > --- a/ivi-shell/ivi-layout-transition.c
> > +++ b/ivi-shell/ivi-layout-transition.c
> > @@ -251,6 +251,7 @@ create_layout_transition(void)
> >
> >         transition->is_done = 0;
> >
> > +       transition->is_transition_func = NULL;
> >         transition->private_data = NULL;
> >         transition->user_data = NULL;
> >
> 
> Maybe this should be using xzalloc, that seems to be the standard method in
> Weston

xzalloc would terminate, which presumably wouldn't be desirable here,
but yeah calloc or even better zalloc would be better practice.  But I
think that can be a follow up, and this patch is fine meantime.

Bryce


More information about the wayland-devel mailing list