free() data returned by TIFFGetField() ?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

free() data returned by TIFFGetField() ?

Paul J. Lucas
When doing TIFFGetField() for fields that return void* and a length,  
e.g., TIFFTAG_ICCPROFILE, is it necessary to free the data returned?  
I.e., is it copied to a buffer that the caller is responsible for  
freeing?

- Paul
_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/
Reply | Threaded
Open this post in threaded view
|

Re: free() data returned by TIFFGetField() ?

Joris Van Damme (AWare Systems)
Paul J. Lucas wrote:
> When doing TIFFGetField() for fields that return void* and a length,
> e.g., TIFFTAG_ICCPROFILE, is it necessary to free the data returned?
> I.e., is it copied to a buffer that the caller is responsible for
> freeing?

No, it is not necessary nor permitted to free that data. A pointer to a
data block internally allocated, managed, and freed by the library
itself, is returned.


Best regards,

Joris Van Damme
[hidden email]
http://www.awaresystems.be/
Download your free TIFF tag viewer for windows here:
http://www.awaresystems.be/imaging/tiff/astifftagviewer.html

_______________________________________________
Tiff mailing list: [hidden email]
http://lists.maptools.org/mailman/listinfo/tiff
http://www.remotesensing.org/libtiff/