process: handle execvp failure in runAsync (#107)

This commit is contained in:
Visal Vijay 2026-04-26 15:27:51 +05:30 committed by GitHub
parent fa3992be2d
commit afb9009312
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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)) {