diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:00 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2022-11-30 18:47:00 +0000 |
commit | 03bf87dcb06f7021bfb2df2fa8691593c6148aff (patch) | |
tree | e16b06711a2ed77cafb4b7754be0220c3d14a9d7 /aclk/schema-wrappers/connection.cc | |
parent | Adding upstream version 1.36.1. (diff) | |
download | netdata-03bf87dcb06f7021bfb2df2fa8691593c6148aff.tar.xz netdata-03bf87dcb06f7021bfb2df2fa8691593c6148aff.zip |
Adding upstream version 1.37.0.upstream/1.37.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'aclk/schema-wrappers/connection.cc')
-rw-r--r-- | aclk/schema-wrappers/connection.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/aclk/schema-wrappers/connection.cc b/aclk/schema-wrappers/connection.cc index 7520a460..20b40ece 100644 --- a/aclk/schema-wrappers/connection.cc +++ b/aclk/schema-wrappers/connection.cc @@ -29,7 +29,7 @@ char *generate_update_agent_connection(size_t *len, const update_agent_connectio timestamp->set_nanos(tv.tv_usec * 1000); if (data->capabilities) { - struct capability *capa = data->capabilities; + const struct capability *capa = data->capabilities; while (capa->name) { aclk_lib::v1::Capability *proto_capa = connupd.add_capabilities(); capability_set(proto_capa, capa); @@ -38,7 +38,7 @@ char *generate_update_agent_connection(size_t *len, const update_agent_connectio } *len = PROTO_COMPAT_MSG_SIZE(connupd); - char *msg = (char*)malloc(*len); + char *msg = (char*)mallocz(*len); if (msg) connupd.SerializeToArray(msg, *len); @@ -52,7 +52,7 @@ struct disconnect_cmd *parse_disconnect_cmd(const char *data, size_t len) { if (!req.ParseFromArray(data, len)) return NULL; - res = (struct disconnect_cmd *)calloc(1, sizeof(struct disconnect_cmd)); + res = (struct disconnect_cmd *)callocz(1, sizeof(struct disconnect_cmd)); if (!res) return NULL; @@ -61,9 +61,9 @@ struct disconnect_cmd *parse_disconnect_cmd(const char *data, size_t len) { res->permaban = req.permaban(); res->error_code = req.error_code(); if (req.error_description().c_str()) { - res->error_description = strdup(req.error_description().c_str()); + res->error_description = strdupz(req.error_description().c_str()); if (!res->error_description) { - free(res); + freez(res); return NULL; } } |