aboutsummaryrefslogtreecommitdiff
path: root/tests/hd-geo-test.c
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2016-08-05 11:03:12 +0100
committerPeter Maydell <peter.maydell@linaro.org>2016-09-08 10:43:58 +0100
commit0813cbf913b04c856bffa87aa005423082325ac1 (patch)
treefa7979007b12ecbcfc37a0fd88df624151497a26 /tests/hd-geo-test.c
parent7faae0b36e51ffdb17d4716ddc40dcfa682d93d9 (diff)
tests/hd-geo-test: Don't pass NULL to unlink()
The unlink() function doesn't accept a NULL pointer, so don't pass it one. Spotted by the clang sanitizer. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: John Snow <jsnow@redhat.com> Message-id: 1470391392-28274-1-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'tests/hd-geo-test.c')
-rw-r--r--tests/hd-geo-test.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c
index 12ee3929da..6176e81ab2 100644
--- a/tests/hd-geo-test.c
+++ b/tests/hd-geo-test.c
@@ -416,7 +416,9 @@ int main(int argc, char **argv)
ret = g_test_run();
for (i = 0; i < backend_last; i++) {
- unlink(img_file_name[i]);
+ if (img_file_name[i]) {
+ unlink(img_file_name[i]);
+ }
}
return ret;