Fix two resource leaks

Signed-off-by: Nikola Forró <nforro@redhat.com>
This commit is contained in:
Nikola Forró 2018-10-31 11:50:48 +01:00
parent 99b10edde9
commit 2f694198f1
2 changed files with 3 additions and 0 deletions

View File

@ -283,6 +283,8 @@ main(int argc, char* argv[])
if (TIFFWriteScanline(out, buf, row, 0) < 0)
break;
}
if (in != stdin)
fclose(in);
(void) TIFFClose(out);
if (buf)
_TIFFfree(buf);

View File

@ -3020,6 +3020,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
"for t2p_readwrite_pdf_image_tile, %s",
(unsigned long) t2p->tiff_datasize,
TIFFFileName(input));
_TIFFfree(buffer);
t2p->t2p_error = T2P_ERR_ERROR;
return(0);
}