summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2022-02-14 10:29:24 +0100
committerFabian Kosmale <fabian.kosmale@qt.io>2022-02-15 12:05:33 +0100
commit06e45cbd6a2e09bc32cb1c9aa3779d6bd5282c45 (patch)
treeae0ef84a0c26df963a1c53567a2fc9d7416c11f1 /tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp
parente1b76e68d0dae2eff00dc70fe56ca5e6029045e6 (diff)
QFileSystemEngine::canonicalName (Unix): clean up control-flow
When passing a nullptr to realpath, it will allocate memory. That memory has to be freed (with free) later to avoid a leak, which we so far didn't. This patch ensures that we always clean up the memory by using a unique_ptr. As a drive-by, clean up the control-flow: - Always pass either the stack buffer or nullptr to realpath. - Rely on realpath returning nullptr in the error case. Lastly, fix a few coding-style issues. Change-Id: Ia906df77324020c267b087ec52a9a6c47aaa2a59 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/gui/util/qdesktopservices/tst_qdesktopservices.cpp')
0 files changed, 0 insertions, 0 deletions