summaryrefslogtreecommitdiffstats
path: root/aclk/schema-wrappers/connection.cc
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-30 18:47:05 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2022-11-30 18:47:05 +0000
commit97e01009d69b8fbebfebf68f51e3d126d0ed43fc (patch)
tree02e8b836c3a9d89806f3e67d4a5fe9f52dbb0061 /aclk/schema-wrappers/connection.cc
parentReleasing debian version 1.36.1-1. (diff)
downloadnetdata-97e01009d69b8fbebfebf68f51e3d126d0ed43fc.tar.xz
netdata-97e01009d69b8fbebfebf68f51e3d126d0ed43fc.zip
Merging upstream version 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.cc10
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;
}
}