summaryrefslogtreecommitdiffstats
path: root/aclk/schema-wrappers/connection.cc
diff options
context:
space:
mode:
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 7520a4600..20b40ece2 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;
}
}