diff --git a/src/lib/lttng-ctl/lttng-ctl.cpp b/src/lib/lttng-ctl/lttng-ctl.cpp index 057a91e3e..3d0c8b412 100644 --- a/src/lib/lttng-ctl/lttng-ctl.cpp +++ b/src/lib/lttng-ctl/lttng-ctl.cpp @@ -1747,13 +1747,13 @@ int lttng_list_tracepoint_fields(struct lttng_handle *handle, unsigned int nb_event_fields = 0; struct lttng_payload reply; + lttng_payload_init(&reply); + if (handle == NULL) { ret = -LTTNG_ERR_INVALID; goto end; } - lttng_payload_init(&reply); - memset(&lsm, 0, sizeof(lsm)); lsm.cmd_type = LTTNG_LIST_TRACEPOINT_FIELDS; COPY_DOMAIN_PACKED(lsm.domain, handle->domain); @@ -1807,6 +1807,7 @@ int lttng_list_tracepoint_fields(struct lttng_handle *handle, ret = nb_event_fields; end: + lttng_payload_reset(&reply); return ret; }