On an error to fstat a directory handle, a directory handle is
released and is still initialized as if the error had not occurred.
Return NULL early from lttng_directory_handle_create_from_dirfd()
to prevent those erroneous accesses.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ia2a3bb1cfe8c90d3f7f87a68286a9b8524694d3c
if (ret) {
PERROR("Failed to fstat directory file descriptor %i", dirfd);
lttng_directory_handle_release(&handle->ref);
+ handle = NULL;
+ goto end;
}
} else {
handle->directory_inode = RESERVED_AT_FDCWD_INO;