libtiff/tif_lzw.c:224: error: Memory Leak
  memory dynamically allocated by call to `_TIFFmalloc()` at line 211, column 28 is not reachable after line 224, column 10.

libtiff/tif_lzw.c:198:1: start of procedure LZWSetupDecode()
196. }
197. 
198. static int
     ^
199. LZWSetupDecode(TIFF* tif)
200. {

libtiff/tif_lzw.c:201:2: 
199. LZWSetupDecode(TIFF* tif)
200. {
201. 	static const char module[] = "LZWSetupDecode";
      ^
202. 	LZWCodecState* sp = DecoderState(tif);
203. 	int code;

libtiff/tif_lzw.c:202:2: 
200. {
201. 	static const char module[] = "LZWSetupDecode";
202. 	LZWCodecState* sp = DecoderState(tif);
      ^
203. 	int code;
204. 

libtiff/tif_lzw.c:205:6: Taking true branch
203. 	int code;
204. 
205. 	if( sp == NULL )
          ^
206. 	{
207. 		/*

libtiff/tif_lzw.c:211:3: 
209. 		 * values.
210. 		*/
211. 		tif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZWCodecState));
       ^
212. 		if (tif->tif_data == NULL)
213. 		{

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_lzw.c:212:7: Taking false branch
210. 		*/
211. 		tif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZWCodecState));
212. 		if (tif->tif_data == NULL)
           ^
213. 		{
214. 			TIFFErrorExt(tif->tif_clientdata, module, "No space for LZW state block");

libtiff/tif_lzw.c:218:3: 
216. 		}
217. 
218. 		DecoderState(tif)->dec_codetab = NULL;
       ^
219. 		DecoderState(tif)->dec_decode = NULL;
220. 

libtiff/tif_lzw.c:219:3: 
217. 
218. 		DecoderState(tif)->dec_codetab = NULL;
219. 		DecoderState(tif)->dec_decode = NULL;
       ^
220. 
221. 		/*

libtiff/tif_lzw.c:224:10: 
222. 		 * Setup predictor setup.
223. 		 */
224. 		(void) TIFFPredictorInit(tif);
              ^
225. 
226. 		sp = DecoderState(tif);

libtiff/tif_predict.c:634:1: start of procedure TIFFPredictorInit()
  632. }
  633. 
  634. int
       ^
  635. TIFFPredictorInit(TIFF* tif)
  636. {

libtiff/tif_predict.c:637:2: 
  635. TIFFPredictorInit(TIFF* tif)
  636. {
  637. 	TIFFPredictorState* sp = PredictorState(tif);
        ^
  638. 
  639. 	assert(sp != 0);

libtiff/tif_predict.c:639:2: Condition is true
  637. 	TIFFPredictorState* sp = PredictorState(tif);
  638. 
  639. 	assert(sp != 0);
        ^
  640. 
  641. 	/*

libtiff/tif_predict.c:644:7: Taking true branch
  642. 	 * Merge codec-specific tag information.
  643. 	 */
  644. 	if (!_TIFFMergeFields(tif, predictFields,
             ^
  645. 			      TIFFArrayCount(predictFields))) {
  646. 		TIFFErrorExt(tif->tif_clientdata, "TIFFPredictorInit",

libtiff/tif_predict.c:646:3: 
  644. 	if (!_TIFFMergeFields(tif, predictFields,
  645. 			      TIFFArrayCount(predictFields))) {
  646. 		TIFFErrorExt(tif->tif_clientdata, "TIFFPredictorInit",
         ^
  647. 		    "Merging Predictor codec-specific tags failed");
  648. 		return 0;

libtiff/tif_error.c:62:1: start of procedure TIFFErrorExt()
    60. }
    61. 
    62. void
        ^
    63. TIFFErrorExt(thandle_t fd, const char* module, const char* fmt, ...)
    64. {

libtiff/tif_error.c:66:2: 
    64. {
    65. 	va_list ap;
    66. 	va_start(ap, fmt);
         ^
    67. 	if (_TIFFerrorHandler)
    68. 		(*_TIFFerrorHandler)(module, fmt, ap);

libtiff/tif_error.c:67:6: Taking false branch
    65. 	va_list ap;
    66. 	va_start(ap, fmt);
    67. 	if (_TIFFerrorHandler)
             ^
    68. 		(*_TIFFerrorHandler)(module, fmt, ap);
    69. 	if (_TIFFerrorHandlerExt)

libtiff/tif_error.c:69:6: Taking false branch
    67. 	if (_TIFFerrorHandler)
    68. 		(*_TIFFerrorHandler)(module, fmt, ap);
    69. 	if (_TIFFerrorHandlerExt)
             ^
    70. 		(*_TIFFerrorHandlerExt)(fd, module, fmt, ap);
    71. 	va_end(ap);

libtiff/tif_error.c:71:2: 
    69. 	if (_TIFFerrorHandlerExt)
    70. 		(*_TIFFerrorHandlerExt)(fd, module, fmt, ap);
    71. 	va_end(ap);
         ^
    72. }
    73. 

libtiff/tif_error.c:72:1: return from a call to TIFFErrorExt
    70. 		(*_TIFFerrorHandlerExt)(fd, module, fmt, ap);
    71. 	va_end(ap);
    72. }
        ^
    73. 

libtiff/tif_predict.c:648:3: 
  646. 		TIFFErrorExt(tif->tif_clientdata, "TIFFPredictorInit",
  647. 		    "Merging Predictor codec-specific tags failed");
  648. 		return 0;
         ^
  649. 	}
  650. 

libtiff/tif_predict.c:673:1: return from a call to TIFFPredictorInit
  671. 	sp->decodepfunc = NULL;			/* no predictor routine */
  672. 	return 1;
  673. }
       ^
  674. 
  675. int

static int
LZWSetupDecode(TIFF* tif)
{
	static const char module[] = "LZWSetupDecode";
	LZWCodecState* sp = DecoderState(tif);
	int code;
	if( sp == NULL )
	{
		tif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZWCodecState));
		if (tif->tif_data == NULL)
		{
			TIFFErrorExt(tif->tif_clientdata, module, "No space for LZW state block");
			return (0);
		}
		DecoderState(tif)->dec_codetab = NULL;
		DecoderState(tif)->dec_decode = NULL;
		(void) TIFFPredictorInit(tif);
		sp = DecoderState(tif);
	}
	assert(sp != NULL);
	if (sp->dec_codetab == NULL) {
		sp->dec_codetab = (code_t*)_TIFFmalloc(CSIZE*sizeof (code_t));
		if (sp->dec_codetab == NULL) {
			TIFFErrorExt(tif->tif_clientdata, module,
				     "No space for LZW code table");
			return (0);
		}
		code = 255;
		do {
			sp->dec_codetab[code].value = code;
			sp->dec_codetab[code].firstchar = code;
			sp->dec_codetab[code].length = 1;
			sp->dec_codetab[code].next = NULL;
		} while (code--);
                 _TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0,
			     (CODE_FIRST - CODE_CLEAR) * sizeof (code_t));
	}
	return (1);
}
['static int\nLZWSetupDecode(TIFF* tif)\n{\n\tstatic const char module[] = "LZWSetupDecode";\n\tLZWCodecState* sp = DecoderState(tif);\n\tint code;\n\tif( sp == NULL )\n\t{\n\t\ttif->tif_data = (uint8*) _TIFFmalloc(sizeof(LZWCodecState));\n\t\tif (tif->tif_data == NULL)\n\t\t{\n\t\t\tTIFFErrorExt(tif->tif_clientdata, module, "No space for LZW state block");\n\t\t\treturn (0);\n\t\t}\n\t\tDecoderState(tif)->dec_codetab = NULL;\n\t\tDecoderState(tif)->dec_decode = NULL;\n\t\t(void) TIFFPredictorInit(tif);\n\t\tsp = DecoderState(tif);\n\t}\n\tassert(sp != NULL);\n\tif (sp->dec_codetab == NULL) {\n\t\tsp->dec_codetab = (code_t*)_TIFFmalloc(CSIZE*sizeof (code_t));\n\t\tif (sp->dec_codetab == NULL) {\n\t\t\tTIFFErrorExt(tif->tif_clientdata, module,\n\t\t\t\t     "No space for LZW code table");\n\t\t\treturn (0);\n\t\t}\n\t\tcode = 255;\n\t\tdo {\n\t\t\tsp->dec_codetab[code].value = code;\n\t\t\tsp->dec_codetab[code].firstchar = code;\n\t\t\tsp->dec_codetab[code].length = 1;\n\t\t\tsp->dec_codetab[code].next = NULL;\n\t\t} while (code--);\n                 _TIFFmemset(&sp->dec_codetab[CODE_CLEAR], 0,\n\t\t\t     (CODE_FIRST - CODE_CLEAR) * sizeof (code_t));\n\t}\n\treturn (1);\n}', 'void*\n_TIFFmalloc(tmsize_t s)\n{\n\treturn (malloc((size_t) s));\n}', 'int\nTIFFPredictorInit(TIFF* tif)\n{\n\tTIFFPredictorState* sp = PredictorState(tif);\n\tassert(sp != 0);\n\tif (!_TIFFMergeFields(tif, predictFields,\n\t\t\t      TIFFArrayCount(predictFields))) {\n\t\tTIFFErrorExt(tif->tif_clientdata, "TIFFPredictorInit",\n\t\t    "Merging Predictor codec-specific tags failed");\n\t\treturn 0;\n\t}\n\tsp->vgetparent = tif->tif_tagmethods.vgetfield;\n\ttif->tif_tagmethods.vgetfield =\n            PredictorVGetField;\n\tsp->vsetparent = tif->tif_tagmethods.vsetfield;\n\ttif->tif_tagmethods.vsetfield =\n\t    PredictorVSetField;\n\tsp->printdir = tif->tif_tagmethods.printdir;\n\ttif->tif_tagmethods.printdir =\n            PredictorPrintDir;\n\tsp->setupdecode = tif->tif_setupdecode;\n\ttif->tif_setupdecode = PredictorSetupDecode;\n\tsp->setupencode = tif->tif_setupencode;\n\ttif->tif_setupencode = PredictorSetupEncode;\n\tsp->predictor = 1;\n\tsp->encodepfunc = NULL;\n\tsp->decodepfunc = NULL;\n\treturn 1;\n}', 'void\nTIFFErrorExt(thandle_t fd, const char* module, const char* fmt, ...)\n{\n\tva_list ap;\n\tva_start(ap, fmt);\n\tif (_TIFFerrorHandler)\n\t\t(*_TIFFerrorHandler)(module, fmt, ap);\n\tif (_TIFFerrorHandlerExt)\n\t\t(*_TIFFerrorHandlerExt)(fd, module, fmt, ap);\n\tva_end(ap);\n}']