File tiff-CVE-2025-9165.patch of Package tiff.40314

Index: tiff-4.0.9/tools/tiffcmp.c
===================================================================
--- tiff-4.0.9.orig/tools/tiffcmp.c
+++ tiff-4.0.9/tools/tiffcmp.c
@@ -95,7 +95,10 @@ main(int argc, char* argv[])
 		return (-1);
 	tif2 = TIFFOpen(argv[optind+1], "r");
 	if (tif2 == NULL)
+	{
+		TIFFClose(tif1);
 		return (-2);
+	}
 	dirnum = 0;
 	while (tiffcmp(tif1, tif2)) {
 		if (!TIFFReadDirectory(tif1)) {
openSUSE Build Service is sponsored by