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

libtiff/tif_getimage.c:2218:1: start of procedure setupMap()
2216.  * process also handles inverting B&W images when needed.
2217.  */ 
2218. static int
      ^
2219. setupMap(TIFFRGBAImage* img)
2220. {

libtiff/tif_getimage.c:2223:5: 
2221.     int32 x, range;
2222. 
2223.     range = (int32)((1L<<img->bitspersample)-1);
          ^
2224.     
2225.     /* treat 16 bit the same as eight bit */

libtiff/tif_getimage.c:2226:9: Taking false branch
2224.     
2225.     /* treat 16 bit the same as eight bit */
2226.     if( img->bitspersample == 16 )
              ^
2227.         range = (int32) 255;
2228. 

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

libtiff/tif_getimage.c:2235:9: Taking true branch
2233. 		return (0);
2234.     }
2235.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
              ^
2236. 	for (x = 0; x <= range; x++)
2237. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);

libtiff/tif_getimage.c:2236:7: 
2234.     }
2235.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2236. 	for (x = 0; x <= range; x++)
            ^
2237. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2238.     } else {

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

libtiff/tif_getimage.c:2237:6: 
2235.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2236. 	for (x = 0; x <= range; x++)
2237. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
           ^
2238.     } else {
2239. 	for (x = 0; x <= range; x++)

libtiff/tif_getimage.c:2236:26: 
2234.     }
2235.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2236. 	for (x = 0; x <= range; x++)
                               ^
2237. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2238.     } else {

libtiff/tif_getimage.c:2236:14: Loop condition is false. Leaving loop
2234.     }
2235.     if (img->photometric == PHOTOMETRIC_MINISWHITE) {
2236. 	for (x = 0; x <= range; x++)
                   ^
2237. 	    img->Map[x] = (TIFFRGBValue) (((range - x) * 255) / range);
2238.     } else {

libtiff/tif_getimage.c:2242:9: Taking true branch
2240. 	    img->Map[x] = (TIFFRGBValue) ((x * 255) / range);
2241.     }
2242.     if (img->bitspersample <= 16 &&
              ^
2243. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2244. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {

libtiff/tif_getimage.c:2243:3: Taking false branch
2241.     }
2242.     if (img->bitspersample <= 16 &&
2243. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
        ^
2244. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
2245. 	/*

libtiff/tif_getimage.c:2244:3: Taking true branch
2242.     if (img->bitspersample <= 16 &&
2243. 	(img->photometric == PHOTOMETRIC_MINISBLACK ||
2244. 	 img->photometric == PHOTOMETRIC_MINISWHITE)) {
        ^
2245. 	/*
2246. 	 * Use photometric mapping table to construct

libtiff/tif_getimage.c:2249:7: Skipping makebwmap(): empty list of specs
2247. 	 * unpacking tables for samples <= 8 bits.
2248. 	 */
2249. 	if (!makebwmap(img))
            ^
2250. 	    return (0);
2251. 	/* no longer need Map, free it */
