Blame SOURCES/0013-bz1602597-Fix-two-resource-leaks.patch

edc570
From 14212e5d19b47d02a4989aa31b9a326c1b131460 Mon Sep 17 00:00:00 2001
edc570
From: =?UTF-8?q?Nikola=20Forr=C3=B3?= <nforro@redhat.com>
edc570
Date: Wed, 31 Oct 2018 11:50:48 +0100
edc570
Subject: [PATCH] (bz1602597) Fix two resource leaks
edc570
MIME-Version: 1.0
edc570
Content-Type: text/plain; charset=UTF-8
edc570
Content-Transfer-Encoding: 8bit
edc570
edc570
Signed-off-by: Nikola Forró <nforro@redhat.com>
edc570
(cherry picked from commit 2f694198f1931e144e0a07a7fb50546b5b70e3ef)
edc570
---
edc570
 tools/ppm2tiff.c | 2 ++
edc570
 tools/tiff2pdf.c | 1 +
edc570
 2 files changed, 3 insertions(+)
edc570
b03815
diff --git a/tools/ppm2tiff.c b/tools/ppm2tiff.c
edc570
index 81ffa3db..a02e865a 100644
b03815
--- a/tools/ppm2tiff.c
b03815
+++ b/tools/ppm2tiff.c
b03815
@@ -285,6 +285,8 @@ main(int argc, char* argv[])
b03815
 		if (TIFFWriteScanline(out, buf, row, 0) < 0)
b03815
 			break;
b03815
 	}
b03815
+	if (in != stdin)
b03815
+		fclose(in);
b03815
 	(void) TIFFClose(out);
b03815
 	if (buf)
b03815
 		_TIFFfree(buf);
b03815
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c
edc570
index bd23c9e5..ff7b9c22 100644
b03815
--- a/tools/tiff2pdf.c
b03815
+++ b/tools/tiff2pdf.c
b03815
@@ -3020,6 +3020,7 @@ tsize_t t2p_readwrite_pdf_image_tile(T2P* t2p, TIFF* input, TIFF* output, ttile_
b03815
                                         "for t2p_readwrite_pdf_image_tile, %s", 
b03815
 					(unsigned long) t2p->tiff_datasize, 
b03815
 					TIFFFileName(input));
b03815
+				_TIFFfree(buffer);
b03815
 				t2p->t2p_error = T2P_ERR_ERROR;
b03815
 				return(0);
b03815
 			}