diff --git a/src/api/process.c b/src/api/process.c index 8460740f..6442d0d2 100644 --- a/src/api/process.c +++ b/src/api/process.c @@ -140,7 +140,10 @@ static int process_start(lua_State* L) } ); - ASSERT_REPROC_ERRNO(L, out); + if (out < 0) { + reproc_destroy(proc); + L_RETURN_REPROC_ERROR(L, out); + } process_t* self = lua_newuserdata(L, sizeof(process_t)); self->process = proc;