X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Flib%2Flttng-ctl%2Flttng-ctl.c;h=f503fd1cbf42a25660a990d869c7adeb467cc823;hp=0dd12b26f3222584e2b53703a37364ce76c2dcb4;hb=d9f484bc6f074842bc4ac3eab0127fe3aaa10909;hpb=ec005ec6d2d9e72e44b6614a573114f03669f242 diff --git a/src/lib/lttng-ctl/lttng-ctl.c b/src/lib/lttng-ctl/lttng-ctl.c index 0dd12b26f..f503fd1cb 100644 --- a/src/lib/lttng-ctl/lttng-ctl.c +++ b/src/lib/lttng-ctl/lttng-ctl.c @@ -1959,6 +1959,11 @@ int lttng_list_events(struct lttng_handle *handle, goto end; } + if (!cmd_header) { + ret = -LTTNG_ERR_UNK; + goto end; + } + /* Set number of events and free command header */ nb_events = cmd_header->nb_events; if (nb_events > INT_MAX) { @@ -2722,7 +2727,7 @@ int lttng_list_tracker_pids(struct lttng_handle *handle, int enabled = 1; struct lttcomm_session_msg lsm; size_t nr_pids; - int32_t *pids; + int32_t *pids = NULL; if (handle == NULL) { return -LTTNG_ERR_INVALID;