From 232c11c37c9e76cd8b1c76d982d5dcb55b137686 Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Mon, 22 Apr 2024 09:45:12 +0200 Subject: [PATCH] dcp: avoid file descriptor leak on error. If the provided file doesn't contain valid dcp metadata the DCPProfile constructor will return without closing the file descriptor. --- rtengine/dcp.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 940b3c0c0..524ecf8af 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -1134,6 +1134,7 @@ DCPProfile::DCPProfile(const Glib::ustring& filename) : DCPMetadata md(file); if (!md.parse()) { printf ("Unable to load DCP profile '%s'.", filename.c_str()); + fclose(file); return; }