aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/src/worker.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/worker.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/worker.c b/src/worker.c
index fbf609b..baba9b0 100644
--- a/src/worker.c
+++ b/src/worker.c
@@ -88,13 +88,19 @@ static int msg_ci_run_handler(struct worker *worker, const struct msg *request)
int ret = 0;
ret = msg_ci_run_do(request->argv[1], request->argv[2], &result);
+ proc_output_free(&result);
+
if (ret < 0)
- msg_error(&response);
+ ret = msg_error(&response);
else
- msg_success(&response);
- proc_output_free(&result);
+ ret = msg_success(&response);
- return msg_send(worker->fd, &response);
+ if (ret < 0)
+ return ret;
+
+ ret = msg_send(worker->fd, &response);
+ msg_free(&response);
+ return ret;
}
static int msg_ci_run_parser(const struct msg *msg)