Fix: possible null dereference
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Tue, 4 Feb 2020 21:03:00 +0000 (16:03 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 7 Feb 2020 21:03:12 +0000 (16:03 -0500)
lttng_inode_create can return null.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Change-Id: I70be9ebabe097d10fb3ee5f46f0b299c02d08ce0
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/fd-tracker/inode.c

index b894f8fbf6d6d41073cd14a94ea63a5d7285e3b0..16dd49a6ff2c95230efd1aba28fe2788d11c5722 100644 (file)
@@ -522,6 +522,10 @@ struct lttng_inode *lttng_inode_registry_get_inode(
 
        inode = lttng_inode_create(&id, registry->inodes, unlinked_file_pool,
                        handle, path);
+       if (!inode) {
+               goto end_unlock;
+       }
+
        node = cds_lfht_add_unique(registry->inodes,
                        lttng_inode_id_hash(&inode->id), lttng_inode_match,
                        &inode->id, &inode->registry_node);
This page took 0.033836 seconds and 4 git commands to generate.