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

libtiff/tif_getimage.c:2331:1: start of procedure setupMap()
2329.  * process also handles inverting B&W images when needed.
2330.  */ 
2331. static int
      ^
2332. setupMap(TIFFRGBAImage* img)
2333. {

libtiff/tif_getimage.c:2336:5: 
2334.     int32 x, range;
2335. 
2336.     range = (int32)((1L<<img->bitspersample)-1);
          ^
2337.     
2338.     /* treat 16 bit the same as eight bit */

libtiff/tif_getimage.c:2339:9: Taking false branch
2337.     
2338.     /* treat 16 bit the same as eight bit */
2339.     if( img->bitspersample == 16 )
              ^
2340.         range = (int32) 255;
2341. 

libtiff/tif_getimage.c:2342:5: 
2340.         range = (int32) 255;
2341. 
2342.     img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
          ^
2343.     if (img->Map == NULL) {
2344. 		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif),

libtiff/tif_unix.c:257:1: start of procedure _TIFFmalloc()
  255. #endif
  256. 
  257. void*
       ^
  258. _TIFFmalloc(tmsize_t s)
  259. {

libtiff/tif_unix.c:260:13: Taking false branch
  258. _TIFFmalloc(tmsize_t s)
  259. {
  260.         if (s == 0)
                   ^
  261.                 return ((void *) NULL);
  262. 

libtiff/tif_unix.c:263:2: 
  261.                 return ((void *) NULL);
  262. 
  263. 	return (malloc((size_t) s));
        ^
  264. }
  265. 

libtiff/tif_unix.c:264:1: return from a call to _TIFFmalloc
  262. 
  263. 	return (malloc((size_t) s));
  264. }
       ^
  265. 
  266. void

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

libtiff/tif_getimage.c:2348:9: Taking true branch
2346. 		return (0);
2347.     }
2348.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
              ^
2349. 	for (x = 0; x <= range; x++)
2350. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);

libtiff/tif_getimage.c:2349:7: 
2347.     }
2348.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2349. 	for (x = 0; x <= range; x++)
            ^
2350. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2351.     } else {

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

libtiff/tif_getimage.c:2350:6: 
2348.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2349. 	for (x = 0; x <= range; x++)
2350. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
           ^
2351.     } else {
2352. 	for (x = 0; x <= range; x++)

libtiff/tif_getimage.c:2349:26: 
2347.     }
2348.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2349. 	for (x = 0; x <= range; x++)
                               ^
2350. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2351.     } else {

libtiff/tif_getimage.c:2349:14: Loop condition is false. Leaving loop
2347.     }
2348.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2349. 	for (x = 0; x <= range; x++)
                   ^
2350. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2351.     } else {

libtiff/tif_getimage.c:2355:9: Taking true branch
2353. 	    img->Map[x] = (TIFFRGBValue) ((x * 255) / range);
2354.     }
2355.     if (img->bitspersample <= 16 &&
              ^
2356. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2357. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {

libtiff/tif_getimage.c:2356:3: Taking false branch
2354.     }
2355.     if (img->bitspersample <= 16 &&
2356. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
        ^
2357. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
2358. 	/*

libtiff/tif_getimage.c:2357:3: Taking true branch
2355.     if (img->bitspersample <= 16 &&
2356. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2357. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
        ^
2358. 	/*
2359. 	 * Use photometric mapping table to construct

libtiff/tif_getimage.c:2362:7: Skipping makebwmap(): empty list of specs
2360. 	 * unpacking tables for samples <= 8 bits.
2361. 	 */
2362. 	if (!makebwmap(img))
            ^
2363. 	    return (0);
2364. 	/* no longer need Map, free it */
