From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59969) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVbyL-0008EG-Fr for qemu-devel@nongnu.org; Fri, 05 Aug 2016 06:03:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bVbyJ-0003ZQ-GB for qemu-devel@nongnu.org; Fri, 05 Aug 2016 06:03:20 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:58551) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bVbyJ-0003ZH-99 for qemu-devel@nongnu.org; Fri, 05 Aug 2016 06:03:19 -0400 From: Peter Maydell Date: Fri, 5 Aug 2016 11:03:12 +0100 Message-Id: <1470391392-28274-1-git-send-email-peter.maydell@linaro.org> Subject: [Qemu-devel] [PATCH] tests/hd-geo-test: Don't pass NULL to unlink() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: patches@linaro.org 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 --- tests/hd-geo-test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 @@ 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; -- 2.7.4