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

libtiff/tif_getimage.c:2426:1: start of procedure setupMap()
2424.  * process also handles inverting B&W images when needed.
2425.  */ 
2426. static int
      ^
2427. setupMap(TIFFRGBAImage* img)
2428. {

libtiff/tif_getimage.c:2431:5: 
2429.     int32 x, range;
2430. 
2431.     range = (int32)((1L<<img->bitspersample)-1);
          ^
2432.     
2433.     /* treat 16 bit the same as eight bit */

libtiff/tif_getimage.c:2434:9: Taking false branch
2432.     
2433.     /* treat 16 bit the same as eight bit */
2434.     if( img->bitspersample == 16 )
              ^
2435.         range = (int32) 255;
2436. 

libtiff/tif_getimage.c:2437:5: 
2435.         range = (int32) 255;
2436. 
2437.     img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
          ^
2438.     if (img->Map == NULL) {
2439. 		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* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)

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

libtiff/tif_getimage.c:2443:9: Taking true branch
2441. 		return (0);
2442.     }
2443.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
              ^
2444. 	for (x = 0; x <= range; x++)
2445. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);

libtiff/tif_getimage.c:2444:7: 
2442.     }
2443.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2444. 	for (x = 0; x <= range; x++)
            ^
2445. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2446.     } else {

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

libtiff/tif_getimage.c:2445:6: 
2443.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2444. 	for (x = 0; x <= range; x++)
2445. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
           ^
2446.     } else {
2447. 	for (x = 0; x <= range; x++)

libtiff/tif_getimage.c:2444:26: 
2442.     }
2443.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2444. 	for (x = 0; x <= range; x++)
                               ^
2445. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2446.     } else {

libtiff/tif_getimage.c:2444:14: Loop condition is false. Leaving loop
2442.     }
2443.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2444. 	for (x = 0; x <= range; x++)
                   ^
2445. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2446.     } else {

libtiff/tif_getimage.c:2450:9: Taking true branch
2448. 	    img->Map[x] = (TIFFRGBValue) ((x * 255) / range);
2449.     }
2450.     if (img->bitspersample <= 16 &&
              ^
2451. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2452. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {

libtiff/tif_getimage.c:2451:3: Taking false branch
2449.     }
2450.     if (img->bitspersample <= 16 &&
2451. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
        ^
2452. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
2453. 	/*

libtiff/tif_getimage.c:2452:3: Taking true branch
2450.     if (img->bitspersample <= 16 &&
2451. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2452. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
        ^
2453. 	/*
2454. 	 * Use photometric mapping table to construct

libtiff/tif_getimage.c:2457:7: Skipping makebwmap(): empty list of specs
2455. 	 * unpacking tables for samples <= 8 bits.
2456. 	 */
2457. 	if (!makebwmap(img))
            ^
2458. 	    return (0);
2459. 	/* no longer need Map, free it */
