X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=tests%2Fregression%2Ftools%2Flive%2Flive_test.cpp;fp=tests%2Fregression%2Ftools%2Flive%2Flive_test.cpp;h=2da5b6fe4e069911af17dbda6bb386a1873f3686;hp=439d862d4b0fbbaf117dd2fa0be3fffa5699b9c6;hb=64803277bbdbe0a943360d918298a48157d9da55;hpb=60f1b42d6280b6bd386abb726dca4fd3b31d8491 diff --git a/tests/regression/tools/live/live_test.cpp b/tests/regression/tools/live/live_test.cpp index 439d862d4..2da5b6fe4 100644 --- a/tests/regression/tools/live/live_test.cpp +++ b/tests/regression/tools/live/live_test.cpp @@ -285,7 +285,7 @@ int attach_session(uint64_t id) int i; ssize_t ret_len; - session = (live_session *) zmalloc(sizeof(struct live_session)); + session = zmalloc(); if (!session) { goto error; } @@ -327,8 +327,7 @@ int attach_session(uint64_t id) diag("Got session stream count == 0"); goto error; } - session->streams = (viewer_stream *) zmalloc(session->stream_count * - sizeof(struct viewer_stream)); + session->streams = calloc(session->stream_count); if (!session->streams) { goto error; } @@ -436,7 +435,7 @@ retry: goto error; } - data = (char *) zmalloc(len); + data = calloc(len); if (!data) { PERROR("relay data zmalloc"); goto error;