X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fbuffer-registry.c;h=e64e4375ed139ab0c51d2f300a6dd47b96a4ebfc;hb=da3c9ec137aaec74635ca1f5584040c20b1d3d7b;hp=6a35284fe70eab9435052a86874537d2936b40f7;hpb=07d2ae956551db46c137f85847a6d2972b1b0c9d;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/buffer-registry.c b/src/bin/lttng-sessiond/buffer-registry.c index 6a35284fe..e64e4375e 100644 --- a/src/bin/lttng-sessiond/buffer-registry.c +++ b/src/bin/lttng-sessiond/buffer-registry.c @@ -25,6 +25,7 @@ #include "fd-limit.h" #include "ust-consumer.h" #include "ust-ctl.h" +#include "utils.h" /* * Set in main.c during initialization process of the daemon. This contains @@ -119,7 +120,7 @@ int buffer_reg_uid_create(int session_id, uint32_t bits_per_long, uid_t uid, } reg->registry = zmalloc(sizeof(struct buffer_reg_session)); - if (!reg) { + if (!reg->registry) { PERROR("zmalloc buffer registry uid session"); ret = -ENOMEM; goto error; @@ -239,7 +240,7 @@ int buffer_reg_pid_create(int session_id, struct buffer_reg_pid **regp) } reg->registry = zmalloc(sizeof(struct buffer_reg_session)); - if (!reg) { + if (!reg->registry) { PERROR("zmalloc buffer registry pid session"); ret = -ENOMEM; goto error; @@ -548,7 +549,7 @@ static void buffer_reg_session_destroy(struct buffer_reg_session *regp, } rcu_read_unlock(); - lttng_ht_destroy(regp->channels); + ht_cleanup_push(regp->channels); switch (domain) { case LTTNG_DOMAIN_UST: @@ -692,6 +693,6 @@ void buffer_reg_pid_destroy(struct buffer_reg_pid *regp) void buffer_reg_destroy_registries(void) { DBG3("Buffer registry destroy all registry"); - lttng_ht_destroy(buffer_registry_uid); - lttng_ht_destroy(buffer_registry_pid); + ht_cleanup_push(buffer_registry_uid); + ht_cleanup_push(buffer_registry_pid); }