From 63c861bd62870a344c1246855228562f3442171a Mon Sep 17 00:00:00 2001 From: David Goulet Date: Wed, 19 Jun 2013 16:17:10 -0400 Subject: [PATCH] Fix: wrong check after malloc in buffer registry Signed-off-by: David Goulet --- src/bin/lttng-sessiond/buffer-registry.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-sessiond/buffer-registry.c b/src/bin/lttng-sessiond/buffer-registry.c index ad103d1de..e64e4375e 100644 --- a/src/bin/lttng-sessiond/buffer-registry.c +++ b/src/bin/lttng-sessiond/buffer-registry.c @@ -120,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; @@ -240,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; -- 2.34.1