Hi,

Don't know about clang. Coverity is pretty smart, and it has found some 
sophisticated bugs for me in projects other than lcms, but still, 
sometimes pops up with false positives. On Qt for example, foreach 
calling delete on destructor turns it crazy.

Fine, I have reviewed the cmsOpenProfileFromStream code and it seems ok 
to me, as long as you call cmsCloseProfile() your should not leak 
resources. Thanks for reporting anyway.

Regards
Marti

El 25/04/2013 18:16, Richard Hughes escribió:
> Hi all,
>
> colord supports reading in ICC profiles from a file descriptor. To do
> this I'm currently doing:
>
>      str = fdopen(fd, "r");
>      if (str == NULL)
>          goto out;
>      lcms_profile = cmsOpenProfileFromStream(str, "r");
>
> I'm wondering if I should be calling fclose() on the 'str' obect.
> Looking at cmsio0.c this seems to have iohandler->Close = FileClose
> which seems to suggest that fclose() will get called for me by
> cmsCloseIOhandler() in cmsCloseProfile and the stream has been kinda
> "adopted" by lcms.
>
> This adoption seems to confuse clang and coverity, both telling me I'm
> not doing fclose() and that I'm leaking memory. I wanted a sanity
> check before I report bugs, thanks.
>
> Richard
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
> _______________________________________________
> Lcms-user mailing list
> Lcms-user@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/lcms-user
>


------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
Lcms-user mailing list
Lcms-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lcms-user

Reply via email to