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

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

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

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

libtiff/tif_getimage.c:2377:5: 
2375.         range = (int32) 255;
2376. 
2377.     img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
          ^
2378.     if (img->Map == NULL) {
2379. 		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:2378:9: Taking false branch
2376. 
2377.     img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
2378.     if (img->Map == NULL) {
              ^
2379. 		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif),
2380. 			"No space for photometric conversion table");

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

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

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

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

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

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

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

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

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

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