From 2b2fd8ba4c2cdfdbde9261bac7b62190624b7fca Mon Sep 17 00:00:00 2001 From: Peter Hillman Date: Sat, 8 Feb 2020 18:47:08 +1300 Subject: [PATCH] fix leak in InputPart constructor logic Signed-off-by: Peter Hillman --- OpenEXR/IlmImf/ImfInputFile.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/OpenEXR/IlmImf/ImfInputFile.cpp b/OpenEXR/IlmImf/ImfInputFile.cpp index 106cb6ecbc..8695c65bf9 100644 --- a/OpenEXR/IlmImf/ImfInputFile.cpp +++ b/OpenEXR/IlmImf/ImfInputFile.cpp @@ -480,7 +480,15 @@ InputFile::InputFile (InputPartData* part) : _data (new Data (part->numThreads)) { _data->_deleteStream=false; - multiPartInitialize (part); + try + { + multiPartInitialize (part); + } + catch(...) + { + delete _data; + throw; + } }