summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/corelib/tools/qbytearray.cpp2
-rw-r--r--src/corelib/tools/qstring.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/tools/qbytearray.cpp b/src/corelib/tools/qbytearray.cpp
index a6bb6afe57..32834ebd7e 100644
--- a/src/corelib/tools/qbytearray.cpp
+++ b/src/corelib/tools/qbytearray.cpp
@@ -3886,7 +3886,7 @@ QByteArray QByteArray::fromRawData(const char *data, int size)
} else if (!size) {
x = shared_empty.data_ptr();
} else {
- x = static_cast<Data *>(malloc(sizeof(Data) + 1));
+ x = static_cast<Data *>(malloc(sizeof(Data)));
Q_CHECK_PTR(x);
x->ref.initializeOwned();
x->size = size;
diff --git a/src/corelib/tools/qstring.cpp b/src/corelib/tools/qstring.cpp
index 5e69a13057..710aec931a 100644
--- a/src/corelib/tools/qstring.cpp
+++ b/src/corelib/tools/qstring.cpp
@@ -7438,7 +7438,7 @@ QString QString::fromRawData(const QChar *unicode, int size)
} else if (!size) {
x = shared_empty.data_ptr();
} else {
- x = static_cast<Data *>(::malloc(sizeof(Data) + sizeof(ushort)));
+ x = static_cast<Data *>(::malloc(sizeof(Data)));
Q_CHECK_PTR(x);
x->ref.initializeOwned();
x->size = size;