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

libtiff/tif_getimage.c:2367:1: start of procedure setupMap()
2365.  * process also handles inverting B&W images when needed.
2366.  */ 
2367. static int
      ^
2368. setupMap(TIFFRGBAImage* img)
2369. {

libtiff/tif_getimage.c:2372:5: 
2370.     int32 x, range;
2371. 
2372.     range = (int32)((1L<<img->bitspersample)-1);
          ^
2373.     
2374.     /* treat 16 bit the same as eight bit */

libtiff/tif_getimage.c:2375:9: Taking false branch
2373.     
2374.     /* treat 16 bit the same as eight bit */
2375.     if( img->bitspersample == 16 )
              ^
2376.         range = (int32) 255;
2377. 

libtiff/tif_getimage.c:2378:5: 
2376.         range = (int32) 255;
2377. 
2378.     img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
          ^
2379.     if (img->Map == NULL) {
2380. 		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif),

libtiff/tif_unix.c:310:1: start of procedure _TIFFmalloc()
  308. #endif
  309. 
  310. void*
       ^
  311. _TIFFmalloc(tmsize_t s)
  312. {

libtiff/tif_unix.c:313:13: Taking false branch
  311. _TIFFmalloc(tmsize_t s)
  312. {
  313.         if (s == 0)
                   ^
  314.                 return ((void *) NULL);
  315. 

libtiff/tif_unix.c:316:2: 
  314.                 return ((void *) NULL);
  315. 
  316. 	return (malloc((size_t) s));
        ^
  317. }
  318. 

libtiff/tif_unix.c:317:1: return from a call to _TIFFmalloc
  315. 
  316. 	return (malloc((size_t) s));
  317. }
       ^
  318. 
  319. void

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

libtiff/tif_getimage.c:2384:9: Taking true branch
2382. 		return (0);
2383.     }
2384.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
              ^
2385. 	for (x = 0; x <= range; x++)
2386. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);

libtiff/tif_getimage.c:2385:7: 
2383.     }
2384.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2385. 	for (x = 0; x <= range; x++)
            ^
2386. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2387.     } else {

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

libtiff/tif_getimage.c:2386:6: 
2384.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2385. 	for (x = 0; x <= range; x++)
2386. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
           ^
2387.     } else {
2388. 	for (x = 0; x <= range; x++)

libtiff/tif_getimage.c:2385:26: 
2383.     }
2384.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2385. 	for (x = 0; x <= range; x++)
                               ^
2386. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2387.     } else {

libtiff/tif_getimage.c:2385:14: Loop condition is false. Leaving loop
2383.     }
2384.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2385. 	for (x = 0; x <= range; x++)
                   ^
2386. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2387.     } else {

libtiff/tif_getimage.c:2391:9: Taking true branch
2389. 	    img->Map[x] = (TIFFRGBValue) ((x * 255) / range);
2390.     }
2391.     if (img->bitspersample <= 16 &&
              ^
2392. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2393. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {

libtiff/tif_getimage.c:2392:3: Taking false branch
2390.     }
2391.     if (img->bitspersample <= 16 &&
2392. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
        ^
2393. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
2394. 	/*

libtiff/tif_getimage.c:2393:3: Taking true branch
2391.     if (img->bitspersample <= 16 &&
2392. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2393. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
        ^
2394. 	/*
2395. 	 * Use photometric mapping table to construct

libtiff/tif_getimage.c:2398:7: Skipping makebwmap(): empty list of specs
2396. 	 * unpacking tables for samples <= 8 bits.
2397. 	 */
2398. 	if (!makebwmap(img))
            ^
2399. 	    return (0);
2400. 	/* no longer need Map, free it */
