From: Jonathan Rajotte Date: Tue, 4 Feb 2020 21:03:00 +0000 (-0500) Subject: Fix: possible null dereference X-Git-Tag: v2.13.0-rc1~772 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=640b9481e1805d314256361ed49d55dcc35d6172;p=lttng-tools.git Fix: possible null dereference lttng_inode_create can return null. Signed-off-by: Jonathan Rajotte Change-Id: I70be9ebabe097d10fb3ee5f46f0b299c02d08ce0 Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/fd-tracker/inode.c b/src/common/fd-tracker/inode.c index b894f8fbf..16dd49a6f 100644 --- a/src/common/fd-tracker/inode.c +++ b/src/common/fd-tracker/inode.c @@ -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);