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

libtiff/tif_getimage.c:2337:1: start of procedure setupMap()
2335.  * process also handles inverting B&W images when needed.
2336.  */ 
2337. static int
      ^
2338. setupMap(TIFFRGBAImage* img)
2339. {

libtiff/tif_getimage.c:2342:5: 
2340.     int32 x, range;
2341. 
2342.     range = (int32)((1L<<img->bitspersample)-1);
          ^
2343.     
2344.     /* treat 16 bit the same as eight bit */

libtiff/tif_getimage.c:2345:9: Taking false branch
2343.     
2344.     /* treat 16 bit the same as eight bit */
2345.     if( img->bitspersample == 16 )
              ^
2346.         range = (int32) 255;
2347. 

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

libtiff/tif_getimage.c:2354:9: Taking true branch
2352. 		return (0);
2353.     }
2354.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
              ^
2355. 	for (x = 0; x <= range; x++)
2356. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);

libtiff/tif_getimage.c:2355:7: 
2353.     }
2354.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2355. 	for (x = 0; x <= range; x++)
            ^
2356. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2357.     } else {

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

libtiff/tif_getimage.c:2356:6: 
2354.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2355. 	for (x = 0; x <= range; x++)
2356. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
           ^
2357.     } else {
2358. 	for (x = 0; x <= range; x++)

libtiff/tif_getimage.c:2355:26: 
2353.     }
2354.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2355. 	for (x = 0; x <= range; x++)
                               ^
2356. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2357.     } else {

libtiff/tif_getimage.c:2355:14: Loop condition is false. Leaving loop
2353.     }
2354.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2355. 	for (x = 0; x <= range; x++)
                   ^
2356. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2357.     } else {

libtiff/tif_getimage.c:2361:9: Taking true branch
2359. 	    img->Map[x] = (TIFFRGBValue) ((x * 255) / range);
2360.     }
2361.     if (img->bitspersample <= 16 &&
              ^
2362. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2363. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {

libtiff/tif_getimage.c:2362:3: Taking false branch
2360.     }
2361.     if (img->bitspersample <= 16 &&
2362. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
        ^
2363. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
2364. 	/*

libtiff/tif_getimage.c:2363:3: Taking true branch
2361.     if (img->bitspersample <= 16 &&
2362. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2363. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
        ^
2364. 	/*
2365. 	 * Use photometric mapping table to construct

libtiff/tif_getimage.c:2368:7: Skipping makebwmap(): empty list of specs
2366. 	 * unpacking tables for samples <= 8 bits.
2367. 	 */
2368. 	if (!makebwmap(img))
            ^
2369. 	    return (0);
2370. 	/* no longer need Map, free it */
