summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2019-08-22 19:09:46 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2019-08-22 22:58:41 +0200
commitff398785bede2b403f8f8e6391ce07538f6cc213 (patch)
treeabcbbe06a1ade56fa51110dd125c2a3fbccaf062 /shell
parent7a6f8baa738c7ec0348015f5c423802e10a524fd (diff)
kf5backend.cxx: Use 'free()' instead of 'delete'
'strdup' doc [1] mentions: "The returned pointer must be passed to 'free' to avoid a memory leak." This silences a "Mismatched free() / delete / delete []" error that valgrind outputs. [1] https://en.cppreference.com/w/c/experimental/dynamic/strdup Change-Id: I28877be762256a7b995c09415a8ad9977b7998c4 Reviewed-on: https://gerrit.libreoffice.org/77974 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/backends/kf5be/kf5backend.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/shell/source/backends/kf5be/kf5backend.cxx b/shell/source/backends/kf5be/kf5backend.cxx
index a2cae6c6c4fd..f55a5150bd3f 100644
--- a/shell/source/backends/kf5be/kf5backend.cxx
+++ b/shell/source/backends/kf5be/kf5backend.cxx
@@ -190,7 +190,7 @@ void initQApp(std::map<OUString, css::beans::Optional<css::uno::Any>>& rSettings
std::unique_ptr<QApplication> app(new QApplication(nFakeArgc, pFakeArgv));
QObject::connect(app.get(), &QObject::destroyed, app.get(), [nFakeArgc, pFakeArgv]() {
for (int i = 0; i < nFakeArgc; ++i)
- delete pFakeArgv[i];
+ free(pFakeArgv[i]);
delete[] pFakeArgv;
});