From: David Goulet Date: Wed, 19 Jun 2013 20:17:10 +0000 (-0400) Subject: Fix: wrong check after malloc in buffer registry X-Git-Tag: v2.2.0-rc3~5 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=63c861bd62870a344c1246855228562f3442171a;p=lttng-tools.git Fix: wrong check after malloc in buffer registry Signed-off-by: David Goulet --- 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;