summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-26 13:59:09 (GMT)
committerMarius Storm-Olsen <marius.storm-olsen@nokia.com>2009-11-26 13:59:09 (GMT)
commit0cf58948ac9bb9c35835e18a00737c362b08f3c7 (patch)
treebbb0b76f71df2d0320d1b8559c7d8537a54a4c5f
parent2f00c76081f261e6f357c279206a6a18fdadc472 (diff)
downloadQt-0cf58948ac9bb9c35835e18a00737c362b08f3c7.zip
Qt-0cf58948ac9bb9c35835e18a00737c362b08f3c7.tar.gz
Qt-0cf58948ac9bb9c35835e18a00737c362b08f3c7.tar.bz2
Avoid using return value from a temporary object
The temporary object goes away before the next line is executed, so the pointer to the const data is invalid. Just put it all on one line, and we're ok. Reviewed-by: Brad
-rw-r--r--src/corelib/io/qfsfileengine.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/corelib/io/qfsfileengine.cpp b/src/corelib/io/qfsfileengine.cpp
index 6aace2c..efc09a0 100644
--- a/src/corelib/io/qfsfileengine.cpp
+++ b/src/corelib/io/qfsfileengine.cpp
@@ -140,8 +140,7 @@ QString QFSFileEnginePrivate::canonicalized(const QString &path)
#if defined(Q_OS_UNIX) || defined(Q_OS_SYMBIAN)
// FIXME let's see if this stuff works, then we might be able to remove some of the other code
- const char *fileName = path.toLocal8Bit().constData();
- char *ret = realpath(fileName, (char*)0);
+ char *ret = realpath(path.toLocal8Bit().constData(), (char*)0);
if (ret) {
QString canonicalPath = QDir::cleanPath(QString::fromLocal8Bit(ret));
free(ret);