aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmldebug
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2021-02-17 14:18:53 +0100
committerUlf Hermann <ulf.hermann@qt.io>2021-02-19 00:14:52 +0100
commit76d1bf1e876ca7c949feae5e6dc5a3928daa581f (patch)
treebb90104666d6ccc71dbd4213d1ce9ec0f707ddbd /src/qmldebug
parent9f3bbbbc440517fb848633c1e10dd780b368a80f (diff)
QmlDebug: Check results of malloc()
malloc() might return nullptr. We have Q_CHECK_PTR for that. Change-Id: I134ca4adada0ff6b49cced669df3b3b989338eaa Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qmldebug')
-rw-r--r--src/qmldebug/qqmlprofilerevent_p.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/qmldebug/qqmlprofilerevent_p.h b/src/qmldebug/qqmlprofilerevent_p.h
index 928cda716e..baadcf2433 100644
--- a/src/qmldebug/qqmlprofilerevent_p.h
+++ b/src/qmldebug/qqmlprofilerevent_p.h
@@ -274,6 +274,7 @@ private:
if (m_dataType & External) {
uint length = m_dataLength * (other.m_dataType / 8);
m_data.external = malloc(length);
+ Q_CHECK_PTR(m_data.external);
memcpy(m_data.external, other.m_data.external, length);
} else {
memcpy(&m_data, &other.m_data, sizeof(m_data));
@@ -317,6 +318,7 @@ private:
return;
m_dataType = static_cast<Type>((sizeof(Number) * 8) | External);
m_data.external = malloc(m_dataLength * sizeof(Number));
+ Q_CHECK_PTR(m_data.external);
data = static_cast<Number *>(m_data.external);
} else {
m_dataType = static_cast<Type>(sizeof(Number) * 8);