summaryrefslogtreecommitdiff
path: root/test/unit
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-09-20 10:24:30 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-09-20 14:26:09 +0200
commitebd150366f0852e7ebd32e7743e6a135138320a0 (patch)
tree30371d71ac127b6885e9d0149be4fa1559966fcd /test/unit
parent752a9ec4b44198554b9f998ed6e4a837878fc49f (diff)
downloadlvm2-ebd150366f0852e7ebd32e7743e6a135138320a0.tar.gz
cov: add explicit NULL pointer check
Make obvious to coverity strcmp() is not getting NULL pointer.
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/run.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/unit/run.c b/test/unit/run.c
index 206857159..281991c51 100644
--- a/test/unit/run.c
+++ b/test/unit/run.c
@@ -240,7 +240,7 @@ static unsigned _filter(const char *pattern, struct test_details **tests, unsign
}
for (i = 0; i < nr; i++)
- if (!regexec(&rx, tests[i]->path, 0, NULL, 0))
+ if (tests[i] && !regexec(&rx, tests[i]->path, 0, NULL, 0))
tests[found++] = tests[i];
regfree(&rx);