[Scummvm-git-logs] scummvm branch-2-1 -> bf77ce4e4366cebdae2f8e28e1eff808789141b2
criezy
criezy at scummvm.org
Mon Sep 30 23:07:27 CEST 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
bf77ce4e43 COMMON: Fix memory leaks in iconv error case
Commit: bf77ce4e4366cebdae2f8e28e1eff808789141b2
https://github.com/scummvm/scummvm/commit/bf77ce4e4366cebdae2f8e28e1eff808789141b2
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2019-09-30T22:05:55+01:00
Commit Message:
COMMON: Fix memory leaks in iconv error case
This fixes coverity CID 1405783 and CID 1405784.
Changed paths:
common/encoding.cpp
diff --git a/common/encoding.cpp b/common/encoding.cpp
index 3c70f19..46faebe 100644
--- a/common/encoding.cpp
+++ b/common/encoding.cpp
@@ -197,6 +197,10 @@ char *Encoding::convertIconv(const char *to, const char *from, const char *strin
char *buffer = (char *) calloc(sizeof(char), stringSize);
if (!buffer) {
+#ifndef ICONV_USES_CONST
+ delete[] originalSrc;
+#endif // ICONV_USES_CONST
+ iconv_close(iconvHandle);
warning ("Cannot allocate memory for converting string");
return nullptr;
}
More information about the Scummvm-git-logs
mailing list