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>bb10
parent
e1a810c046
commit
ca211da2fa
|
|
@ -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';
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue