From afb9009312119940b65e266c9b9afbf8d8507432 Mon Sep 17 00:00:00 2001 From: Visal Vijay <150381094+B2krobbery@users.noreply.github.com> Date: Sun, 26 Apr 2026 15:27:51 +0530 Subject: [PATCH] process: handle execvp failure in runAsync (#107) --- 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)) {