libtiff/tif_jpeg.c:751: error: Memory Leak
  memory dynamically allocated by call to `_TIFFmalloc()` at line 739, column 11 is not reachable after line 751, column 7.

libtiff/tif_jpeg.c:702:1: start of procedure JPEGFixupTagsSubsampling()
700. #ifdef CHECK_JPEG_YCBCR_SUBSAMPLING
701. 
702. static void
     ^
703. JPEGFixupTagsSubsampling(TIFF* tif)
704. {

libtiff/tif_jpeg.c:725:2: 
723. 	 * Joris Van Damme, May 2007
724. 	 */
725. 	static const char module[] = "JPEGFixupTagsSubsampling";
      ^
726. 	struct JPEGFixupTagsSubsamplingData m;
727. 

libtiff/tif_jpeg.c:728:13: Taking false branch
726. 	struct JPEGFixupTagsSubsamplingData m;
727. 
728.         if( tif->tif_dir.td_stripbytecount == NULL
                 ^
729.             || tif->tif_dir.td_stripbytecount[0] == 0 )
730.         {

libtiff/tif_jpeg.c:729:16: Taking false branch
727. 
728.         if( tif->tif_dir.td_stripbytecount == NULL
729.             || tif->tif_dir.td_stripbytecount[0] == 0 )
                    ^
730.         {
731.             /* Do not even try to check if the first strip/tile does not

libtiff/tif_jpeg.c:737:2: 
735.         }
736. 
737. 	m.tif=tif;
      ^
738. 	m.buffersize=2048;
739. 	m.buffer=_TIFFmalloc(m.buffersize);

libtiff/tif_jpeg.c:738:2: 
736. 
737. 	m.tif=tif;
738. 	m.buffersize=2048;
      ^
739. 	m.buffer=_TIFFmalloc(m.buffersize);
740. 	if (m.buffer==NULL)

libtiff/tif_jpeg.c:739:2: 
737. 	m.tif=tif;
738. 	m.buffersize=2048;
739. 	m.buffer=_TIFFmalloc(m.buffersize);
      ^
740. 	if (m.buffer==NULL)
741. 	{

libtiff/tif_unix.c:253:1: start of procedure _TIFFmalloc()
  251. #endif
  252. 
  253. void*
       ^
  254. _TIFFmalloc(tmsize_t s)
  255. {

libtiff/tif_unix.c:256:2: 
  254. _TIFFmalloc(tmsize_t s)
  255. {
  256. 	return (malloc((size_t) s));
        ^
  257. }
  258. 

libtiff/tif_unix.c:257:1: return from a call to _TIFFmalloc
  255. {
  256. 	return (malloc((size_t) s));
  257. }
       ^
  258. 
  259. void

libtiff/tif_jpeg.c:740:6: Taking false branch
738. 	m.buffersize=2048;
739. 	m.buffer=_TIFFmalloc(m.buffersize);
740. 	if (m.buffer==NULL)
          ^
741. 	{
742. 		TIFFWarningExt(tif->tif_clientdata,module,

libtiff/tif_jpeg.c:746:2: 
744. 		return;
745. 	}
746. 	m.buffercurrentbyte=NULL;
      ^
747. 	m.bufferbytesleft=0;
748. 	m.fileoffset=tif->tif_dir.td_stripoffset[0];

libtiff/tif_jpeg.c:747:2: 
745. 	}
746. 	m.buffercurrentbyte=NULL;
747. 	m.bufferbytesleft=0;
      ^
748. 	m.fileoffset=tif->tif_dir.td_stripoffset[0];
749. 	m.filepositioned=0;

libtiff/tif_jpeg.c:748:2: 
746. 	m.buffercurrentbyte=NULL;
747. 	m.bufferbytesleft=0;
748. 	m.fileoffset=tif->tif_dir.td_stripoffset[0];
      ^
749. 	m.filepositioned=0;
750. 	m.filebytesleft=tif->tif_dir.td_stripbytecount[0];

libtiff/tif_jpeg.c:749:2: 
747. 	m.bufferbytesleft=0;
748. 	m.fileoffset=tif->tif_dir.td_stripoffset[0];
749. 	m.filepositioned=0;
      ^
750. 	m.filebytesleft=tif->tif_dir.td_stripbytecount[0];
751. 	if (!JPEGFixupTagsSubsamplingSec(&m))

libtiff/tif_jpeg.c:750:2: 
748. 	m.fileoffset=tif->tif_dir.td_stripoffset[0];
749. 	m.filepositioned=0;
750. 	m.filebytesleft=tif->tif_dir.td_stripbytecount[0];
      ^
751. 	if (!JPEGFixupTagsSubsamplingSec(&m))
752. 		TIFFWarningExt(tif->tif_clientdata,module,

libtiff/tif_jpeg.c:751:7: Skipping JPEGFixupTagsSubsamplingSec(): empty list of specs
749. 	m.filepositioned=0;
750. 	m.filebytesleft=tif->tif_dir.td_stripbytecount[0];
751. 	if (!JPEGFixupTagsSubsamplingSec(&m))
           ^
752. 		TIFFWarningExt(tif->tif_clientdata,module,
753. 		    "Unable to auto-correct subsampling values, likely corrupt JPEG compressed data in first strip/tile; auto-correcting skipped");

static void
JPEGFixupTagsSubsampling(TIFF* tif)
{
	static const char module[] = "JPEGFixupTagsSubsampling";
	struct JPEGFixupTagsSubsamplingData m;
        if( tif->tif_dir.td_stripbytecount == NULL
            || tif->tif_dir.td_stripbytecount[0] == 0 )
        {
            return;
        }
	m.tif=tif;
	m.buffersize=2048;
	m.buffer=_TIFFmalloc(m.buffersize);
	if (m.buffer==NULL)
	{
		TIFFWarningExt(tif->tif_clientdata,module,
		    "Unable to allocate memory for auto-correcting of subsampling values; auto-correcting skipped");
		return;
	}
	m.buffercurrentbyte=NULL;
	m.bufferbytesleft=0;
	m.fileoffset=tif->tif_dir.td_stripoffset[0];
	m.filepositioned=0;
	m.filebytesleft=tif->tif_dir.td_stripbytecount[0];
	if (!JPEGFixupTagsSubsamplingSec(&m))
		TIFFWarningExt(tif->tif_clientdata,module,
		    "Unable to auto-correct subsampling values, likely corrupt JPEG compressed data in first strip/tile; auto-correcting skipped");
	_TIFFfree(m.buffer);
}
['static void\nJPEGFixupTagsSubsampling(TIFF* tif)\n{\n\tstatic const char module[] = "JPEGFixupTagsSubsampling";\n\tstruct JPEGFixupTagsSubsamplingData m;\n        if( tif->tif_dir.td_stripbytecount == NULL\n            || tif->tif_dir.td_stripbytecount[0] == 0 )\n        {\n            return;\n        }\n\tm.tif=tif;\n\tm.buffersize=2048;\n\tm.buffer=_TIFFmalloc(m.buffersize);\n\tif (m.buffer==NULL)\n\t{\n\t\tTIFFWarningExt(tif->tif_clientdata,module,\n\t\t    "Unable to allocate memory for auto-correcting of subsampling values; auto-correcting skipped");\n\t\treturn;\n\t}\n\tm.buffercurrentbyte=NULL;\n\tm.bufferbytesleft=0;\n\tm.fileoffset=tif->tif_dir.td_stripoffset[0];\n\tm.filepositioned=0;\n\tm.filebytesleft=tif->tif_dir.td_stripbytecount[0];\n\tif (!JPEGFixupTagsSubsamplingSec(&m))\n\t\tTIFFWarningExt(tif->tif_clientdata,module,\n\t\t    "Unable to auto-correct subsampling values, likely corrupt JPEG compressed data in first strip/tile; auto-correcting skipped");\n\t_TIFFfree(m.buffer);\n}', 'void*\n_TIFFmalloc(tmsize_t s)\n{\n\treturn (malloc((size_t) s));\n}']