summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qstring.cpp
diff options
context:
space:
mode:
authorJoão Abecasis <joao.abecasis@nokia.com>2012-04-04 14:24:01 +0200
committerQt by Nokia <qt-info@nokia.com>2012-04-05 01:45:24 +0200
commitb3f12ea1d40b33e459c95317911251b8a8d5c3f8 (patch)
tree928faeb6ff9d798d8d856aa09b0c48f651c128ff /src/corelib/tools/qstring.cpp
parent98e50a18eda614caeadaeb7a05fc2f5ab4f735e7 (diff)
Don't allocate space for null when using fromRawData
In this case we only need to allocate space for the "header" data. Change-Id: I059627e47a5bae7a02c82d837c826a6ed0fd20fd Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qstring.cpp')
-rw-r--r--src/corelib/tools/qstring.cpp2
1 files changed, 1 insertions, 1 deletions
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;