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

libtiff/tif_jpeg.c:688:1: start of procedure JPEGFixupTagsSubsampling()
686. #ifdef CHECK_JPEG_YCBCR_SUBSAMPLING
687. 
688. static void
     ^
689. JPEGFixupTagsSubsampling(TIFF* tif)
690. {

libtiff/tif_jpeg.c:711:2: 
709. 	 * Joris Van Damme, May 2007
710. 	 */
711. 	static const char module[] = "JPEGFixupTagsSubsampling";
      ^
712. 	struct JPEGFixupTagsSubsamplingData m;
713. 

libtiff/tif_jpeg.c:714:13: Taking false branch
712. 	struct JPEGFixupTagsSubsamplingData m;
713. 
714.         if( tif->tif_dir.td_stripbytecount == NULL
                 ^
715.             || tif->tif_dir.td_stripbytecount[0] == 0 )
716.         {

libtiff/tif_jpeg.c:715:16: Taking false branch
713. 
714.         if( tif->tif_dir.td_stripbytecount == NULL
715.             || tif->tif_dir.td_stripbytecount[0] == 0 )
                    ^
716.         {
717.             /* Do not even try to check if the first strip/tile does not

libtiff/tif_jpeg.c:723:2: 
721.         }
722. 
723. 	m.tif=tif;
      ^
724. 	m.buffersize=2048;
725. 	m.buffer=_TIFFmalloc(m.buffersize);

libtiff/tif_jpeg.c:724:2: 
722. 
723. 	m.tif=tif;
724. 	m.buffersize=2048;
      ^
725. 	m.buffer=_TIFFmalloc(m.buffersize);
726. 	if (m.buffer==NULL)

libtiff/tif_jpeg.c:725:2: 
723. 	m.tif=tif;
724. 	m.buffersize=2048;
725. 	m.buffer=_TIFFmalloc(m.buffersize);
      ^
726. 	if (m.buffer==NULL)
727. 	{

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:726:6: Taking false branch
724. 	m.buffersize=2048;
725. 	m.buffer=_TIFFmalloc(m.buffersize);
726. 	if (m.buffer==NULL)
          ^
727. 	{
728. 		TIFFWarningExt(tif->tif_clientdata,module,

libtiff/tif_jpeg.c:732:2: 
730. 		return;
731. 	}
732. 	m.buffercurrentbyte=NULL;
      ^
733. 	m.bufferbytesleft=0;
734. 	m.fileoffset=tif->tif_dir.td_stripoffset[0];

libtiff/tif_jpeg.c:733:2: 
731. 	}
732. 	m.buffercurrentbyte=NULL;
733. 	m.bufferbytesleft=0;
      ^
734. 	m.fileoffset=tif->tif_dir.td_stripoffset[0];
735. 	m.filepositioned=0;

libtiff/tif_jpeg.c:734:2: 
732. 	m.buffercurrentbyte=NULL;
733. 	m.bufferbytesleft=0;
734. 	m.fileoffset=tif->tif_dir.td_stripoffset[0];
      ^
735. 	m.filepositioned=0;
736. 	m.filebytesleft=tif->tif_dir.td_stripbytecount[0];

libtiff/tif_jpeg.c:735:2: 
733. 	m.bufferbytesleft=0;
734. 	m.fileoffset=tif->tif_dir.td_stripoffset[0];
735. 	m.filepositioned=0;
      ^
736. 	m.filebytesleft=tif->tif_dir.td_stripbytecount[0];
737. 	if (!JPEGFixupTagsSubsamplingSec(&m))

libtiff/tif_jpeg.c:736:2: 
734. 	m.fileoffset=tif->tif_dir.td_stripoffset[0];
735. 	m.filepositioned=0;
736. 	m.filebytesleft=tif->tif_dir.td_stripbytecount[0];
      ^
737. 	if (!JPEGFixupTagsSubsamplingSec(&m))
738. 		TIFFWarningExt(tif->tif_clientdata,module,

libtiff/tif_jpeg.c:737:7: Skipping JPEGFixupTagsSubsamplingSec(): empty list of specs
735. 	m.filepositioned=0;
736. 	m.filebytesleft=tif->tif_dir.td_stripbytecount[0];
737. 	if (!JPEGFixupTagsSubsamplingSec(&m))
           ^
738. 		TIFFWarningExt(tif->tif_clientdata,module,
739. 		    "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}']