fix: call workfree to void mem leak

Signed-off-by: black-desk <me@black-desk.cn>
This commit is contained in:
tsic404 2023-05-12 11:06:50 +08:00 committed by 爱折腾的小竹同学
parent a2f91cc525
commit 38c9c09487

View File

@ -430,6 +430,7 @@ bool StartManager::launch(DesktopInfo *info, QString cmdLine, uint32_t timestamp
auto ret = wordexp(stdCmdLine.c_str(), &words, 0); auto ret = wordexp(stdCmdLine.c_str(), &words, 0);
if (ret != 0) { if (ret != 0) {
qCritical() << "wordexp failed, error code:" << ret; qCritical() << "wordexp failed, error code:" << ret;
wordfree(&words);
return false; return false;
} }
@ -437,6 +438,8 @@ bool StartManager::launch(DesktopInfo *info, QString cmdLine, uint32_t timestamp
exeArgs << words.we_wordv[i]; exeArgs << words.we_wordv[i];
} }
wordfree(&words);
handleRecognizeArgs(exeArgs, files); handleRecognizeArgs(exeArgs, files);
if (info->getTerminal()) { if (info->getTerminal()) {