Fix: wrong check after malloc in buffer registry
authorDavid Goulet <dgoulet@efficios.com>
Wed, 19 Jun 2013 20:17:10 +0000 (16:17 -0400)
committerDavid Goulet <dgoulet@efficios.com>
Wed, 19 Jun 2013 20:17:10 +0000 (16:17 -0400)
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/bin/lttng-sessiond/buffer-registry.c

index ad103d1dec36e2afcf7cfd1f9861feda044aa198..e64e4375ed139ab0c51d2f300a6dd47b96a4ebfc 100644 (file)
@@ -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;
This page took 0.033974 seconds and 4 git commands to generate.