| AWARE [SYSTEMS] | Imaging expertise for the Delphi developer | |||||||
![]() |
TIFF and LibTiff Mailing List Archive | |||||||
LibTiff Mailing List
TIFF and LibTiff Mailing List Archive Contact
The TIFF Mailing List Homepage |
2011.05.30 07:03 "[PATCH] libtiff: avoid leak upon allocation failure", by Jim Meyeringcoverity spotted this potential leak:
2011-05-30 Jim Meyering <meyering@redhat.com>
libtiff: avoid leak upon allocation failure
* libtiff/tif_dirread.c (TIFFFetchStripThing): Free "data" also
upon failure to allocate "resizeddata".
diff --git a/libtiff/tif_dirread.c b/libtiff/tif_dirread.c
index 6f96ec0..a247a31 100644
--- a/libtiff/tif_dirread.c
+++ b/libtiff/tif_dirread.c
@@ -5347,8 +5347,10 @@ TIFFFetchStripThing(TIFF* tif, TIFFDirEntry* dir,
uint32 nstrips, uint64** lpp)
{
uint64* resizeddata;
resizeddata=(uint64*)_TIFFCheckMalloc(tif,nstrips,sizeof(uint64),"for
strip array");
- if (resizeddata==0)
+ if (resizeddata==0) {
+ _TIFFfree(data);
return(0);
+ }
if (dir->tdir_count<(uint64)nstrips)
{
_TIFFmemcpy(resizeddata,data,(uint32)dir->tdir_count*sizeof(uint64));
--
1.7.5.2.660.g9f46c
|
|||||||