Add type-checked versions of allocation and deallocations functions
[lttng-tools.git] / src / common / sessiond-comm / sessiond-comm.cpp
index 7b20007a8ea2ef0068a57cdd6c348043ad0a907c..ed14a9e63ec7af3f721a80d4ee7b1d53d7429eaa 100644 (file)
@@ -178,9 +178,8 @@ error:
  */
 struct lttcomm_sock *lttcomm_alloc_sock(enum lttcomm_sock_proto proto)
 {
-       struct lttcomm_sock *sock;
+       struct lttcomm_sock *sock = zmalloc<lttcomm_sock>();
 
-       sock = (lttcomm_sock *) zmalloc(sizeof(lttcomm_sock));
        if (sock == NULL) {
                PERROR("zmalloc create sock");
                goto end;
@@ -366,11 +365,10 @@ struct lttcomm_relayd_sock *lttcomm_alloc_relayd_sock(struct lttng_uri *uri,
 {
        int ret;
        struct lttcomm_sock *tmp_sock = NULL;
-       struct lttcomm_relayd_sock *rsock = NULL;
+       struct lttcomm_relayd_sock *rsock = zmalloc<lttcomm_relayd_sock>();
 
        LTTNG_ASSERT(uri);
 
-       rsock = (lttcomm_relayd_sock *) zmalloc(sizeof(*rsock));
        if (!rsock) {
                PERROR("zmalloc relayd sock");
                goto error;
This page took 0.023484 seconds and 4 git commands to generate.