On Die, 2010-06-29 at 19:00 +0300, Tiago Vignatti wrote: > Signed-off-by: Tiago Vignatti <[email protected]> > --- > Same as the previous patch: I'm not exactly seeing any problem or segfault > with this code. I just got this issue with the static analyzer. > > hw/xfree86/dri2/dri2.c | 8 ++++++-- > 1 files changed, 6 insertions(+), 2 deletions(-) > > diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c > index d4181c9..26f5ac4 100644 > --- a/hw/xfree86/dri2/dri2.c > +++ b/hw/xfree86/dri2/dri2.c > @@ -207,10 +207,10 @@ DRI2AddDrawableRef(DRI2DrawablePtr pPriv, XID id, XID > dri2_id, > return BadAlloc; > > if (!AddResource(dri2_id, dri2DrawableRes, pPriv)) > - return BadAlloc; > + goto err_out; > if (!DRI2LookupDrawableRef(pPriv, id)) > if (!AddResource(id, dri2DrawableRes, pPriv)) > - return BadAlloc; > + goto err_out;
The second error path should also free the first resource created, shouldn't it? -- Earthling Michel Dänzer | http://www.vmware.com Libre software enthusiast | Debian, X and DRI developer _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
