summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2021-06-10 09:32:10 +0000
committerEven Rouault <even.rouault@spatialys.com>2021-06-10 09:32:10 +0000
commit1eb58f0a65f42cbdd649f3d3d79d598cb7098c46 (patch)
treea4894dd1e67fbd6d1d97f1dfa8b6410e36681b85
parent695c013443d1b5b0430065e3f09ff26471278143 (diff)
parent0bb2247ec49cb48cd93db11d6b5e8efa638f4888 (diff)
downloadlibtiff-git-1eb58f0a65f42cbdd649f3d3d79d598cb7098c46.tar.gz
Merge branch 'fix-263' into 'master'
Fix memory leak in tiff2pdf See merge request libtiff/libtiff!249
-rw-r--r--tools/tiff2pdf.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
index be051c5a..99c2cc8e 100644
--- a/tools/tiff2pdf.c
+++ b/tools/tiff2pdf.c
@@ -2583,7 +2583,7 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
t2p->tiff_datasize,
TIFFFileName(input));
t2p->t2p_error = T2P_ERR_ERROR;
- _TIFFfree(buffer);
+ _TIFFfree(buffer);
return(0);
}
for(i=0;i<stripcount;i++){
@@ -2599,8 +2599,9 @@ tsize_t t2p_readwrite_pdf_image(T2P* t2p, TIFF* input, TIFF* output){
"Error on decoding strip %"PRIu32" of %s",
i + j*stripcount,
TIFFFileName(input));
- _TIFFfree(buffer);
t2p->t2p_error=T2P_ERR_ERROR;
+ _TIFFfree(samplebuffer);
+ _TIFFfree(buffer);
return(0);
}
samplebufferoffset+=read;