[cairo] [PATCH v2 2/2] test: Fix issues reported by cppcheck static analysis tool

RAVI NANJUNDAPPA nravi.n at samsung.com
Sun Aug 24 21:04:00 PDT 2014


> -----Original Message-----
> From: Bryce Harrington [mailto:bryce at osg.samsung.com]
> Sent: Friday, August 22, 2014 8:21 PM
> To: RAVI NANJUNDAPPA
> Cc: 'Bertram Felgenhauer'; cairo at cairographics.org
> Subject: Re: [cairo] [PATCH v2 2/2] test: Fix issues reported by cppcheck
> static analysis tool
> 
> On Fri, Aug 22, 2014 at 11:45:34AM +0530, RAVI NANJUNDAPPA wrote:
> >
> >
> > > -----Original Message-----
> > > From: cairo [mailto:cairo-bounces at cairographics.org] On Behalf Of
> > > Bertram Felgenhauer
> > > Sent: Friday, August 22, 2014 10:58 AM
> > > To: cairo at cairographics.org
> > > Subject: Re: [cairo] [PATCH v2 2/2] test: Fix issues reported by
> > > cppcheck static analysis tool
> > >
> > > RAVI NANJUNDAPPA wrote:
> > > > Hello Bertram,
> > > >
> > > > If you look at the pdf-mime-data.c file, 'free(data)' is handled
> > > > by the callee at line numbers (from original file): 108, 153 and
159.
> > >
> > > Sorry, I had not looked at the callers. It's just unusual that for a
> > failing
> > > function call to leave such cleanup to its callers. Is there any
> > > reason
> > for doing
> > > so in this case?
> >
> > Sure. Not a problem.
> > But am not sure of why in this it is written like this, because
> > usually callee knows whether it has allocated the memory to data or not.
> > As of now, just for retaining the history, I haven't modified it.  I
> > hope that should be fine.
> 
> Since we're tinkering with the test already, may as well fix it up
completely.
> Sounds like we all basically agree it should handle freeing its memory
itself on
> error, can you reroll the patch to do that too?

Hello Bryce, 

As agreed, I've modified the patch to handle freeing its memory (data buffer
which it allocated ) itself on error.
You can look at the latest patches (v4  2/2 and v2  1/2, splitted patches to
handle the issues reported by cppcheck tool, after incorporating review
comments)
and provide your comments. 

Thanks and Best Regards, 
N Ravi

> 
> Bryce
> 
> > Thanks  and Best Regards,
> > N Ravi
> > >
> > > Cheers,
> > >
> > > Bertram
> > > --
> > > cairo mailing list
> > > cairo at cairographics.org
> > > http://lists.cairographics.org/mailman/listinfo/cairo
> >
> > --
> > cairo mailing list
> > cairo at cairographics.org
> > http://lists.cairographics.org/mailman/listinfo/cairo



More information about the cairo mailing list