[Scummvm-git-logs] scummvm master -> b9fab94dbf6515580ca471547bcd3ee06870f75e
sev-
sev at scummvm.org
Mon Apr 27 22:03:49 UTC 2020
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:
b9fab94dbf COMMON: Shut coverity up with tons of false positives
Commit: b9fab94dbf6515580ca471547bcd3ee06870f75e
https://github.com/scummvm/scummvm/commit/b9fab94dbf6515580ca471547bcd3ee06870f75e
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-27T23:51:56+02:00
Commit Message:
COMMON: Shut coverity up with tons of false positives
Changed paths:
common/str.cpp
diff --git a/common/str.cpp b/common/str.cpp
index a60718075e..2ae366bca8 100644
--- a/common/str.cpp
+++ b/common/str.cpp
@@ -229,7 +229,12 @@ void String::decRefCount(int *oldRefCount) {
g_refCountPool->freeChunk(oldRefCount);
unlockMemoryPoolMutex();
}
+ // Coverity thinks that we always free memory, as it assumes
+ // (correctly) that there are cases when oldRefCount == 0
+ // Thus, DO NOT COMPILE, trick it and shut tons of false positives
+#ifndef __COVERITY__
delete[] _str;
+#endif
// Even though _str points to a freed memory block now,
// we do not change its value, because any code that calls
More information about the Scummvm-git-logs
mailing list