Add type-checked versions of allocation and deallocations functions
[lttng-tools.git] / src / common / relayd / relayd.cpp
index 28cab7bc5c8d0500f8615e071d1eac758ca1896c..5148bd03a9ed241e1141add72175fcf137e63f86 100644 (file)
@@ -65,7 +65,7 @@ static int send_command(struct lttcomm_relayd_sock *rsock,
                buf_size += size;
        }
 
-       buf = (char *) zmalloc(buf_size);
+       buf = calloc<char>(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<lttcomm_relayd_create_session_2_11>(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<lttcomm_relayd_add_stream_2_11>(msg_length);
        if (!msg) {
                PERROR("zmalloc add_stream_2_11 command message");
                ret = -1;
This page took 0.023302 seconds and 4 git commands to generate.