From 3f423fa665a6492c84b58b7c31044a898e18a57a Mon Sep 17 00:00:00 2001 From: B2krobbery <150381094+B2krobbery@users.noreply.github.com> Date: Sun, 26 Apr 2026 11:37:44 +0530 Subject: [PATCH] process: handle execvp failure in runAsync --- src/os/Process.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/os/Process.cpp b/src/os/Process.cpp index b6faf55..dd74a0c 100644 --- a/src/os/Process.cpp +++ b/src/os/Process.cpp @@ -49,8 +49,8 @@ bool Hyprutils::OS::CProcess::runSync() { if (pid == -1) { close(outPipe[0]); close(outPipe[1]); - close(outPipe[0]); - close(outPipe[1]); + close(errPipe[0]); + close(errPipe[1]); return false; } @@ -232,7 +232,14 @@ bool Hyprutils::OS::CProcess::runAsync() { } execvp(m_impl->binary.c_str(), argsC.data()); - _exit(0); + + + for (auto ptr : argsC) { + if (ptr) + free(ptr); + } + + _exit(1); } close(socket[0]); if (write(socket[1], &grandchild, sizeof(grandchild)) != sizeof(grandchild)) {