diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2012-04-17 17:07:15 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-19 15:58:03 +0200 |
commit | d48f3fc1e74f4d489238f511df56a134b53e6a0b (patch) | |
tree | 11092fe88e569e16838013ec42a444a965ea5adc /mkspecs/unsupported | |
parent | f4d02ecdbf54987a0bada20fe8f8537e90c051d8 (diff) |
fix undefined behavior issue on Integrity
in contrast to ::strdup(), qstrdup() allocates memory via new[];
deallocating this memory with free() leads to undefine behavior.
Change-Id: I0692c4bef010c05de547283b00b6c6043ac24c79
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
Diffstat (limited to 'mkspecs/unsupported')
-rw-r--r-- | mkspecs/unsupported/integrity-ghs/qplatformdefs.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/mkspecs/unsupported/integrity-ghs/qplatformdefs.h b/mkspecs/unsupported/integrity-ghs/qplatformdefs.h index 87459d874e..4df7dea1d7 100644 --- a/mkspecs/unsupported/integrity-ghs/qplatformdefs.h +++ b/mkspecs/unsupported/integrity-ghs/qplatformdefs.h @@ -170,6 +170,10 @@ #define QT_VSNPRINTF ::vsnprintf #endif +// INTEGRITY doesn't enable the declaration in _POSIX_SOURCE mode, +// because strdup() is not part of strict Posix; declare it here +extern "C" char *strdup(const char *src); + #ifndef MAXNAMLEN # define MAXNAMLEN NAME_MAX #endif |