diff options
author | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-01-17 19:09:56 +0100 |
---|---|---|
committer | Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> | 2021-01-20 08:36:00 +0100 |
commit | ca211da2fa572161904f31499a3dd59e5bb6fc85 (patch) | |
tree | 2c9f79b7f20ad43fb47f7389412f765175295a6f /src | |
parent | e1a810c04635a094d83addfbf8d29ca32b0dd206 (diff) |
QLocale: add a Q_CHECK_PTR
Avoid complaints from static analyzers that the pointer returned
by malloc might be null.
Change-Id: I3ec3ba03d0b5283dd569200a3040a5fe5990f763
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/corelib/text/qlocale_tools.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/text/qlocale_tools.cpp b/src/corelib/text/qlocale_tools.cpp index a8f63a5998..24a6bcfd09 100644 --- a/src/corelib/text/qlocale_tools.cpp +++ b/src/corelib/text/qlocale_tools.cpp @@ -362,6 +362,7 @@ double qt_asciiToDouble(const char *num, qsizetype numLen, bool &ok, int &proces buffer = reasonableBuffer; else buffer = static_cast<char *>(malloc(numLen + 1)); + Q_CHECK_PTR(buffer); memcpy(buffer, num, numLen); buffer[numLen] = '\0'; |