libtiff/tif_ojpeg.c:1774: error: Memory Leak
  memory dynamically allocated to `return` by call to `_TIFFmalloc()` at line 1759, column 7 is not reachable after line 1774, column 5.

libtiff/tif_ojpeg.c:1730:1: start of procedure OJPEGReadHeaderInfoSecTablesQTable()
1728. }
1729. 
1730. static int
      ^
1731. OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif)
1732. {

libtiff/tif_ojpeg.c:1733:2: 
1731. OJPEGReadHeaderInfoSecTablesQTable(TIFF* tif)
1732. {
1733. 	static const char module[]="OJPEGReadHeaderInfoSecTablesQTable";
       ^
1734. 	OJPEGState* sp=(OJPEGState*)tif->tif_data;
1735. 	uint8 m;

libtiff/tif_ojpeg.c:1734:2: 
1732. {
1733. 	static const char module[]="OJPEGReadHeaderInfoSecTablesQTable";
1734. 	OJPEGState* sp=(OJPEGState*)tif->tif_data;
       ^
1735. 	uint8 m;
1736. 	uint8 n;

libtiff/tif_ojpeg.c:1740:6: Taking false branch
1738. 	uint8* ob;
1739. 	uint32 p;
1740. 	if (sp->qtable_offset[0]==0)
           ^
1741. 	{
1742. 		TIFFErrorExt(tif->tif_clientdata,module,"Missing JPEG tables");

libtiff/tif_ojpeg.c:1745:2: 
1743. 		return(0);
1744. 	}
1745. 	sp->in_buffer_file_pos_log=0;
       ^
1746. 	for (m=0; m<sp->samples_per_pixel; m++)
1747. 	{

libtiff/tif_ojpeg.c:1746:7: 
1744. 	}
1745. 	sp->in_buffer_file_pos_log=0;
1746. 	for (m=0; m<sp->samples_per_pixel; m++)
            ^
1747. 	{
1748. 		if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))

libtiff/tif_ojpeg.c:1746:12: Loop condition is true. Entering loop body
1744. 	}
1745. 	sp->in_buffer_file_pos_log=0;
1746. 	for (m=0; m<sp->samples_per_pixel; m++)
                 ^
1747. 	{
1748. 		if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))

libtiff/tif_ojpeg.c:1748:8: Taking true branch
1746. 	for (m=0; m<sp->samples_per_pixel; m++)
1747. 	{
1748. 		if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
             ^
1749. 		{
1750. 			for (n=0; n<m-1; n++)

libtiff/tif_ojpeg.c:1748:38: Taking true branch
1746. 	for (m=0; m<sp->samples_per_pixel; m++)
1747. 	{
1748. 		if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
                                           ^
1749. 		{
1750. 			for (n=0; n<m-1; n++)

libtiff/tif_ojpeg.c:1750:9: 
1748. 		if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
1749. 		{
1750. 			for (n=0; n<m-1; n++)
              ^
1751. 			{
1752. 				if (sp->qtable_offset[m]==sp->qtable_offset[n])

libtiff/tif_ojpeg.c:1750:14: Loop condition is false. Leaving loop
1748. 		if ((sp->qtable_offset[m]!=0) && ((m==0) || (sp->qtable_offset[m]!=sp->qtable_offset[m-1])))
1749. 		{
1750. 			for (n=0; n<m-1; n++)
                   ^
1751. 			{
1752. 				if (sp->qtable_offset[m]==sp->qtable_offset[n])

libtiff/tif_ojpeg.c:1758:4: 
1756. 				}
1757. 			}
1758. 			oa=sizeof(uint32)+69;
         ^
1759. 			ob=_TIFFmalloc(oa);
1760. 			if (ob==0)

libtiff/tif_ojpeg.c:1759:4: 
1757. 			}
1758. 			oa=sizeof(uint32)+69;
1759. 			ob=_TIFFmalloc(oa);
         ^
1760. 			if (ob==0)
1761. 			{

libtiff/tif_unix.c:257:1: start of procedure _TIFFmalloc()
  255. #endif
  256. 
  257. void*
       ^
  258. _TIFFmalloc(tmsize_t s)
  259. {

libtiff/tif_unix.c:260:2: 
  258. _TIFFmalloc(tmsize_t s)
  259. {
  260. 	return (malloc((size_t) s));
        ^
  261. }
  262. 

libtiff/tif_unix.c:261:1: return from a call to _TIFFmalloc
  259. {
  260. 	return (malloc((size_t) s));
  261. }
       ^
  262. 
  263. void

libtiff/tif_ojpeg.c:1760:8: Taking false branch
1758. 			oa=sizeof(uint32)+69;
1759. 			ob=_TIFFmalloc(oa);
1760. 			if (ob==0)
             ^
1761. 			{
1762. 				TIFFErrorExt(tif->tif_clientdata,module,"Out of memory");

libtiff/tif_ojpeg.c:1765:4: 
1763. 				return(0);
1764. 			}
1765. 			*(uint32*)ob=oa;
         ^
1766. 			ob[sizeof(uint32)]=255;
1767. 			ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;

libtiff/tif_ojpeg.c:1766:4: 
1764. 			}
1765. 			*(uint32*)ob=oa;
1766. 			ob[sizeof(uint32)]=255;
         ^
1767. 			ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
1768. 			ob[sizeof(uint32)+2]=0;

libtiff/tif_ojpeg.c:1767:4: 
1765. 			*(uint32*)ob=oa;
1766. 			ob[sizeof(uint32)]=255;
1767. 			ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
         ^
1768. 			ob[sizeof(uint32)+2]=0;
1769. 			ob[sizeof(uint32)+3]=67;

libtiff/tif_ojpeg.c:1768:4: 
1766. 			ob[sizeof(uint32)]=255;
1767. 			ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
1768. 			ob[sizeof(uint32)+2]=0;
         ^
1769. 			ob[sizeof(uint32)+3]=67;
1770. 			ob[sizeof(uint32)+4]=m;

libtiff/tif_ojpeg.c:1769:4: 
1767. 			ob[sizeof(uint32)+1]=JPEG_MARKER_DQT;
1768. 			ob[sizeof(uint32)+2]=0;
1769. 			ob[sizeof(uint32)+3]=67;
         ^
1770. 			ob[sizeof(uint32)+4]=m;
1771. 			TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET); 

libtiff/tif_ojpeg.c:1770:4: 
1768. 			ob[sizeof(uint32)+2]=0;
1769. 			ob[sizeof(uint32)+3]=67;
1770. 			ob[sizeof(uint32)+4]=m;
         ^
1771. 			TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET); 
1772. 			p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);

libtiff/tif_ojpeg.c:1771:4: Skipping __function_pointer__(): unresolved function pointer
1769. 			ob[sizeof(uint32)+3]=67;
1770. 			ob[sizeof(uint32)+4]=m;
1771. 			TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET); 
         ^
1772. 			p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
1773. 			if (p!=64)

libtiff/tif_ojpeg.c:1772:4: Skipping __function_pointer__(): unresolved function pointer
1770. 			ob[sizeof(uint32)+4]=m;
1771. 			TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET); 
1772. 			p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
         ^
1773. 			if (p!=64)
1774. 				return(0);

libtiff/tif_ojpeg.c:1773:8: Taking true branch
1771. 			TIFFSeekFile(tif,sp->qtable_offset[m],SEEK_SET); 
1772. 			p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
1773. 			if (p!=64)
             ^
1774. 				return(0);
1775. 			sp->qtable[m]=ob;

libtiff/tif_ojpeg.c:1774:5: 
1772. 			p=TIFFReadFile(tif,&ob[sizeof(uint32)+5],64);
1773. 			if (p!=64)
1774. 				return(0);
          ^
1775. 			sp->qtable[m]=ob;
1776. 			sp->sof_tq[m]=m;
