X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=lttng-sessiond%2Fkernel-ctl.c;h=52d60f00460ed01660c1578f3060d84eceb28220;hp=203c01050e82199f34128d09b9c5dd95ca6fb0a4;hb=ba7f0ae55f6209514025bb538c6fe3faefc32f4b;hpb=5b4a0ec04ce1ee5a4cf4c8a5896edab28750da56 diff --git a/lttng-sessiond/kernel-ctl.c b/lttng-sessiond/kernel-ctl.c index 203c01050..52d60f004 100644 --- a/lttng-sessiond/kernel-ctl.c +++ b/lttng-sessiond/kernel-ctl.c @@ -49,9 +49,9 @@ int kernel_add_channel_context(struct ltt_kernel_channel *chan, goto error; } - chan->ctx = malloc(sizeof(struct lttng_kernel_context)); + chan->ctx = zmalloc(sizeof(struct lttng_kernel_context)); if (chan->ctx == NULL) { - perror("malloc event context"); + perror("zmalloc event context"); goto error; } @@ -78,9 +78,9 @@ int kernel_add_event_context(struct ltt_kernel_event *event, goto error; } - event->ctx = malloc(sizeof(struct lttng_kernel_context)); + event->ctx = zmalloc(sizeof(struct lttng_kernel_context)); if (event->ctx == NULL) { - perror("malloc event context"); + perror("zmalloc event context"); goto error; } @@ -574,7 +574,7 @@ ssize_t kernel_list_events(int tracer_fd, struct lttng_event **events) * See kernel-ctl.h for explanation of this value */ nbmem = KERNEL_EVENT_LIST_SIZE; - elist = malloc(sizeof(struct lttng_event) * nbmem); + elist = zmalloc(sizeof(struct lttng_event) * nbmem); while ((size = fscanf(fp, "event { name = %m[^;]; };%n\n", &event, &pos)) == 1) { if (count > nbmem) {