Fix QFileSystemEngine::canonicalName() returning corrupt data
authorThomas McGuire <thomas.mcguire.qnx@kdab.com>
Mon, 10 Sep 2012 07:54:14 +0000 (09:54 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 10 Sep 2012 12:09:45 +0000 (14:09 +0200)
commitad5d64226abd50a43856ab560583f37b49ff04c9
tree9a624ba5e44ee8bd03802b04d37dea3559ed107a
parente9c9e8bfa93b467a06a6cd872712845cacc465c8
Fix QFileSystemEngine::canonicalName() returning corrupt data

In case of an error when calling realpath(), the return value buffer
was uninitalized, but still used.
Now the error value is checked to prevent this. Additionally, this fixes
a memory leak in the error case.

In addition, use the modern version of realpath() on QNX, since it is
available there.

Change-Id: I0ac83454679619f379df9c482c958789ab31866a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org>
src/corelib/io/qfilesystemengine_unix.cpp