Merge pull request #85002 from alesliehughes/tinyexr_mem_leak

Fix memory leak on error paths in tinyexr loader
This commit is contained in:
Rémi Verschelde 2023-12-04 23:08:47 +01:00
commit 2f4f87dc56
No known key found for this signature in database
GPG Key ID: C3336907360768E1

View File

@ -68,6 +68,7 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, Ref<FileAccess> f, BitF
if (ret != TINYEXR_SUCCESS) {
if (err) {
ERR_PRINT(String(err));
FreeEXRErrorMessage(err);
}
return ERR_FILE_CORRUPT;
}
@ -86,6 +87,7 @@ Error ImageLoaderTinyEXR::load_image(Ref<Image> p_image, Ref<FileAccess> f, BitF
if (ret != TINYEXR_SUCCESS) {
if (err) {
ERR_PRINT(String(err));
FreeEXRErrorMessage(err);
}
return ERR_FILE_CORRUPT;
}