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
diff --git a/tests/hd-geo-test.c b/tests/hd-geo-test.c
index 12ee392..6176e81 100644
--- a/tests/hd-geo-test.c
+++ b/tests/hd-geo-test.c
@@ -416,7 +416,9 @@
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;