From 2da174ff4379002ad9d266c906cb00b6e27d4bef Mon Sep 17 00:00:00 2001 From: Tomasz Gromadzki Date: Tue, 12 Mar 2024 17:35:48 +0100 Subject: [PATCH] obj: fix coverity issue 1976786 Signed-off-by: Tomasz Gromadzki --- src/libpmemobj/ctl_debug.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libpmemobj/ctl_debug.c b/src/libpmemobj/ctl_debug.c index b1cb70eea59..6c20de9ef0e 100644 --- a/src/libpmemobj/ctl_debug.c +++ b/src/libpmemobj/ctl_debug.c @@ -1,5 +1,5 @@ // SPDX-License-Identifier: BSD-3-Clause -/* Copyright 2018-2021, Intel Corporation */ +/* Copyright 2018-2024, Intel Corporation */ /* * ctl_debug.c -- implementation of the debug CTL namespace @@ -38,6 +38,8 @@ CTL_READ_HANDLER(alloc_pattern)(void *ctx, PMEMobjpool *pop = ctx; int *arg_out = arg; + if (pop == NULL) + return -1; *arg_out = pop->heap.alloc_pattern; return 0;