diff options
author | Sami Rosendahl <ext-sami.1.rosendahl@nokia.com> | 2012-01-24 09:01:27 (GMT) |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-01 08:36:41 (GMT) |
commit | 0e97dc311b812aeea5fda5dcaf6d43f0807d548d (patch) | |
tree | c1aa4e3d2645acda58a7390c8c35a08e8f72f81e /src | |
parent | fe3f0a5003135cdeb7c8fc478fd63ec026a51963 (diff) | |
download | Qt-0e97dc311b812aeea5fda5dcaf6d43f0807d548d.zip Qt-0e97dc311b812aeea5fda5dcaf6d43f0807d548d.tar.gz Qt-0e97dc311b812aeea5fda5dcaf6d43f0807d548d.tar.bz2 |
Fix delete/free mismatch in QtXmlPatterns
Fixes valgrind warning like this:
Mismatched free() / delete / delete []
at: operator delete(void*) (vg_replace_malloc.c:387)
by: QPatternist::Decimal::toString(double) (qdecimal.cpp:121)
Reason for the warning is that toString above calls qdtoa the result of
which should be released with free(), not delete.
Change-Id: I5ed04a67b91ca5270e28cb2b244612d2b0c437ac
(cherry picked from commit 900091e51ead9594d0b1f513cabeba0ebc067dce)
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Diffstat (limited to 'src')
-rw-r--r-- | src/xmlpatterns/data/qdecimal.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/xmlpatterns/data/qdecimal.cpp b/src/xmlpatterns/data/qdecimal.cpp index 2afe0eb..b55f2ae 100644 --- a/src/xmlpatterns/data/qdecimal.cpp +++ b/src/xmlpatterns/data/qdecimal.cpp @@ -118,7 +118,7 @@ QString Decimal::toString(const xsDecimal value) /* If the copy constructor is used instead of QString::operator=(), * it doesn't compile. I have no idea why. */ const QString qret(QString::fromLatin1(result)); - delete result; + free(result); QString valueAsString; |