libtiff/tif_getimage.c:2320: error: Memory Leak
  memory dynamically allocated by call to `_TIFFmalloc()` at line 2300, column 32 is not reachable after line 2320, column 7.

libtiff/tif_getimage.c:2289:1: start of procedure setupMap()
2287.  * process also handles inverting B&W images when needed.
2288.  */ 
2289. static int
      ^
2290. setupMap(TIFFRGBAImage* img)
2291. {

libtiff/tif_getimage.c:2294:5: 
2292.     int32 x, range;
2293. 
2294.     range = (int32)((1L<<img->bitspersample)-1);
          ^
2295.     
2296.     /* treat 16 bit the same as eight bit */

libtiff/tif_getimage.c:2297:9: Taking false branch
2295.     
2296.     /* treat 16 bit the same as eight bit */
2297.     if( img->bitspersample == 16 )
              ^
2298.         range = (int32) 255;
2299. 

libtiff/tif_getimage.c:2300:5: 
2298.         range = (int32) 255;
2299. 
2300.     img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
          ^
2301.     if (img->Map == NULL) {
2302. 		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif),

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:13: Taking false branch
  258. _TIFFmalloc(tmsize_t s)
  259. {
  260.         if (s == 0)
                   ^
  261.                 return ((void *) NULL);
  262. 

libtiff/tif_unix.c:263:2: 
  261.                 return ((void *) NULL);
  262. 
  263. 	return (malloc((size_t) s));
        ^
  264. }
  265. 

libtiff/tif_unix.c:264:1: return from a call to _TIFFmalloc
  262. 
  263. 	return (malloc((size_t) s));
  264. }
       ^
  265. 
  266. void

libtiff/tif_getimage.c:2301:9: Taking false branch
2299. 
2300.     img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
2301.     if (img->Map == NULL) {
              ^
2302. 		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif),
2303. 			"No space for photometric conversion table");

libtiff/tif_getimage.c:2306:9: Taking true branch
2304. 		return (0);
2305.     }
2306.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
              ^
2307. 	for (x = 0; x <= range; x++)
2308. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);

libtiff/tif_getimage.c:2307:7: 
2305.     }
2306.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2307. 	for (x = 0; x <= range; x++)
            ^
2308. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2309.     } else {

libtiff/tif_getimage.c:2307:14: Loop condition is true. Entering loop body
2305.     }
2306.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2307. 	for (x = 0; x <= range; x++)
                   ^
2308. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2309.     } else {

libtiff/tif_getimage.c:2308:6: 
2306.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2307. 	for (x = 0; x <= range; x++)
2308. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
           ^
2309.     } else {
2310. 	for (x = 0; x <= range; x++)

libtiff/tif_getimage.c:2307:26: 
2305.     }
2306.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2307. 	for (x = 0; x <= range; x++)
                               ^
2308. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2309.     } else {

libtiff/tif_getimage.c:2307:14: Loop condition is false. Leaving loop
2305.     }
2306.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2307. 	for (x = 0; x <= range; x++)
                   ^
2308. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2309.     } else {

libtiff/tif_getimage.c:2313:9: Taking true branch
2311. 	    img->Map[x] = (TIFFRGBValue) ((x * 255) / range);
2312.     }
2313.     if (img->bitspersample <= 16 &&
              ^
2314. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2315. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {

libtiff/tif_getimage.c:2314:3: Taking false branch
2312.     }
2313.     if (img->bitspersample <= 16 &&
2314. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
        ^
2315. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
2316. 	/*

libtiff/tif_getimage.c:2315:3: Taking true branch
2313.     if (img->bitspersample <= 16 &&
2314. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2315. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
        ^
2316. 	/*
2317. 	 * Use photometric mapping table to construct

libtiff/tif_getimage.c:2320:7: Skipping makebwmap(): empty list of specs
2318. 	 * unpacking tables for samples <= 8 bits.
2319. 	 */
2320. 	if (!makebwmap(img))
            ^
2321. 	    return (0);
2322. 	/* no longer need Map, free it */
