X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fkernel-consumer.c;h=38820af3811e1893ba8a5f6c6109c31599fb7838;hp=4153612746f90c84780b208b94ce2ce731126217;hb=53efb85a242809ed5ed21e9ab40effa696ecbc6f;hpb=8f0044bfed9f5ca51eab51478f483f92cc8f84a7 diff --git a/src/bin/lttng-sessiond/kernel-consumer.c b/src/bin/lttng-sessiond/kernel-consumer.c index 415361274..38820af38 100644 --- a/src/bin/lttng-sessiond/kernel-consumer.c +++ b/src/bin/lttng-sessiond/kernel-consumer.c @@ -105,7 +105,7 @@ int kernel_consumer_add_channel(struct consumer_socket *sock, } } else { /* Empty path. */ - pathname = ""; + pathname = strdup(""); } /* Prep channel message structure */ @@ -136,6 +136,7 @@ int kernel_consumer_add_channel(struct consumer_socket *sock, health_code_update(); error: + free(pathname); return ret; } @@ -168,7 +169,7 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, } } else { /* Empty path. */ - pathname = ""; + pathname = strdup(""); } /* Prep channel message structure */ @@ -215,6 +216,7 @@ int kernel_consumer_add_metadata(struct consumer_socket *sock, health_code_update(); error: + free(pathname); return ret; } @@ -419,6 +421,7 @@ int kernel_consumer_destroy_channel(struct consumer_socket *socket, DBG("Sending kernel consumer destroy channel key %d", channel->fd); + memset(&msg, 0, sizeof(msg)); msg.cmd_type = LTTNG_CONSUMER_DESTROY_CHANNEL; msg.u.destroy_channel.key = channel->fd; @@ -447,6 +450,7 @@ int kernel_consumer_destroy_metadata(struct consumer_socket *socket, DBG("Sending kernel consumer destroy channel key %d", metadata->fd); + memset(&msg, 0, sizeof(msg)); msg.cmd_type = LTTNG_CONSUMER_DESTROY_CHANNEL; msg.u.destroy_channel.key = metadata->fd;