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

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

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

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

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

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

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

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

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

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

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

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

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

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

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