diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-09 04:52:47 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-06-09 04:52:57 +0000 |
commit | 00151562145df50cc65e9902d52d5fa77f89fe50 (patch) | |
tree | 2737716802f6725a5074d606ec8fe5422c58a83c /spawn/spawn_client.c | |
parent | Releasing debian version 1.34.1-1. (diff) | |
download | netdata-00151562145df50cc65e9902d52d5fa77f89fe50.tar.xz netdata-00151562145df50cc65e9902d52d5fa77f89fe50.zip |
Merging upstream version 1.35.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'spawn/spawn_client.c')
-rw-r--r-- | spawn/spawn_client.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/spawn/spawn_client.c b/spawn/spawn_client.c index 509c67347..3e37e7967 100644 --- a/spawn/spawn_client.c +++ b/spawn/spawn_client.c @@ -21,7 +21,10 @@ static void after_pipe_write(uv_write_t* req, int status) #ifdef SPAWN_DEBUG info("CLIENT %s called status=%d", __func__, status); #endif - freez(req->data); + void **data = req->data; + freez(data[0]); + freez(data[1]); + freez(data); } static void client_parse_spawn_protocol(unsigned source_len, char *source) @@ -135,11 +138,16 @@ static void on_read_alloc(uv_handle_t* handle, static void spawn_process_cmd(struct spawn_cmd_info *cmdinfo) { int ret; - uv_buf_t writebuf[3]; + uv_buf_t *writebuf; struct write_context *write_ctx; + void **data = callocz(2, sizeof(void *)); + writebuf = callocz(3, sizeof(uv_buf_t)); write_ctx = callocz(1, sizeof(*write_ctx)); - write_ctx->write_req.data = write_ctx; + + data[0] = write_ctx; + data[1] = writebuf; + write_ctx->write_req.data = data; uv_mutex_lock(&cmdinfo->mutex); cmdinfo->flags |= SPAWN_CMD_PROCESSED; |