From 4fbed4be20377e5b1a6e71f572eb28ed049ed3fe Mon Sep 17 00:00:00 2001 From: Christian Göttsche Date: Thu, 4 Jan 2024 17:46:48 +0100 Subject: tests: avoid NULL dereference in error branch Reported by cppcheck. --- tests/tst-pam_getenvlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests') diff --git a/tests/tst-pam_getenvlist.c b/tests/tst-pam_getenvlist.c index 62aea061..d6abac91 100644 --- a/tests/tst-pam_getenvlist.c +++ b/tests/tst-pam_getenvlist.c @@ -78,7 +78,7 @@ main (void) { fprintf (stderr, "pam_getenvlist (pamh) does not return pointer to NULL\n"); - temp = *ptr; + temp = ptr ? *ptr : NULL; var = 0; while (temp) { -- cgit v1.2.3