From e8f835b3dce6a3caee382a568cb6df414424faa9 Mon Sep 17 00:00:00 2001 From: darealshinji Date: Tue, 31 Oct 2023 21:59:40 +0100 Subject: [PATCH] don't pass NULL pointer to strdup() --- checkrt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/checkrt.c b/checkrt.c index a9391bf..916d996 100644 --- a/checkrt.c +++ b/checkrt.c @@ -237,7 +237,7 @@ char *find_symbol(mmap_t *mem, const char *sym_prefix) } } - return strdup(symbol); + return symbol ? strdup(symbol) : NULL; } /* mmap() library and look for symbol by prefix */