fix memory leak when reproc_start() fails
This commit is contained in:
parent
453df84c82
commit
81157b5d4f
|
@ -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));
|
process_t* self = lua_newuserdata(L, sizeof(process_t));
|
||||||
self->process = proc;
|
self->process = proc;
|
||||||
|
|
Loading…
Reference in New Issue