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

libtiff/tif_getimage.c:2208:1: start of procedure setupMap()
2206.  * process also handles inverting B&W images when needed.
2207.  */ 
2208. static int
      ^
2209. setupMap(TIFFRGBAImage* img)
2210. {

libtiff/tif_getimage.c:2213:5: 
2211.     int32 x, range;
2212. 
2213.     range = (int32)((1L<<img->bitspersample)-1);
          ^
2214.     
2215.     /* treat 16 bit the same as eight bit */

libtiff/tif_getimage.c:2216:9: Taking false branch
2214.     
2215.     /* treat 16 bit the same as eight bit */
2216.     if( img->bitspersample == 16 )
              ^
2217.         range = (int32) 255;
2218. 

libtiff/tif_getimage.c:2219:5: 
2217.         range = (int32) 255;
2218. 
2219.     img->Map = (TIFFRGBValue*) _TIFFmalloc((range+1) * sizeof (TIFFRGBValue));
          ^
2220.     if (img->Map == NULL) {
2221. 		TIFFErrorExt(img->tif->tif_clientdata, TIFFFileName(img->tif),

libtiff/tif_unix.c:253:1: start of procedure _TIFFmalloc()
  251. #endif
  252. 
  253. void*
       ^
  254. _TIFFmalloc(tmsize_t s)
  255. {

libtiff/tif_unix.c:256:2: 
  254. _TIFFmalloc(tmsize_t s)
  255. {
  256. 	return (malloc((size_t) s));
        ^
  257. }
  258. 

libtiff/tif_unix.c:257:1: return from a call to _TIFFmalloc
  255. {
  256. 	return (malloc((size_t) s));
  257. }
       ^
  258. 
  259. void

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

libtiff/tif_getimage.c:2225:9: Taking true branch
2223. 		return (0);
2224.     }
2225.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
              ^
2226. 	for (x = 0; x <= range; x++)
2227. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);

libtiff/tif_getimage.c:2226:7: 
2224.     }
2225.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2226. 	for (x = 0; x <= range; x++)
            ^
2227. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2228.     } else {

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

libtiff/tif_getimage.c:2227:6: 
2225.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2226. 	for (x = 0; x <= range; x++)
2227. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
           ^
2228.     } else {
2229. 	for (x = 0; x <= range; x++)

libtiff/tif_getimage.c:2226:26: 
2224.     }
2225.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2226. 	for (x = 0; x <= range; x++)
                               ^
2227. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2228.     } else {

libtiff/tif_getimage.c:2226:14: Loop condition is false. Leaving loop
2224.     }
2225.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2226. 	for (x = 0; x <= range; x++)
                   ^
2227. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2228.     } else {

libtiff/tif_getimage.c:2232:9: Taking true branch
2230. 	    img->Map[x] = (TIFFRGBValue) ((x * 255) / range);
2231.     }
2232.     if (img->bitspersample <= 16 &&
              ^
2233. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2234. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {

libtiff/tif_getimage.c:2233:3: Taking false branch
2231.     }
2232.     if (img->bitspersample <= 16 &&
2233. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
        ^
2234. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
2235. 	/*

libtiff/tif_getimage.c:2234:3: Taking true branch
2232.     if (img->bitspersample <= 16 &&
2233. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2234. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
        ^
2235. 	/*
2236. 	 * Use photometric mapping table to construct

libtiff/tif_getimage.c:2239:7: Skipping makebwmap(): empty list of specs
2237. 	 * unpacking tables for samples <= 8 bits.
2238. 	 */
2239. 	if (!makebwmap(img))
            ^
2240. 	    return (0);
2241. 	/* no longer need Map, free it */
