X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Frelayd%2Frelayd.cpp;h=5148bd03a9ed241e1141add72175fcf137e63f86;hb=64803277bbdbe0a943360d918298a48157d9da55;hp=28cab7bc5c8d0500f8615e071d1eac758ca1896c;hpb=60f1b42d6280b6bd386abb726dca4fd3b31d8491;p=lttng-tools.git diff --git a/src/common/relayd/relayd.cpp b/src/common/relayd/relayd.cpp index 28cab7bc5..5148bd03a 100644 --- a/src/common/relayd/relayd.cpp +++ b/src/common/relayd/relayd.cpp @@ -65,7 +65,7 @@ static int send_command(struct lttcomm_relayd_sock *rsock, buf_size += size; } - buf = (char *) zmalloc(buf_size); + buf = calloc(buf_size); if (buf == NULL) { PERROR("zmalloc relayd send command buf"); ret = -1; @@ -166,7 +166,7 @@ static int relayd_create_session_2_11(struct lttcomm_relayd_sock *rsock, base_path_len = strlen(base_path) + 1; msg_length = sizeof(*msg) + session_name_len + hostname_len + base_path_len; - msg = (lttcomm_relayd_create_session_2_11 *) zmalloc(msg_length); + msg = zmalloc(msg_length); if (!msg) { PERROR("zmalloc create_session_2_11 command message"); ret = -1; @@ -446,7 +446,7 @@ static int relayd_add_stream_2_11(struct lttcomm_relayd_sock *rsock, pathname_len = strlen(pathname) + 1; msg_length = sizeof(*msg) + channel_name_len + pathname_len; - msg = (lttcomm_relayd_add_stream_2_11 *) zmalloc(msg_length); + msg = zmalloc(msg_length); if (!msg) { PERROR("zmalloc add_stream_2_11 command message"); ret = -1;