From f0c82b07f8b31a4b86de32436cb4f5053de16336 Mon Sep 17 00:00:00 2001 From: Daiki Ueno Date: Thu, 22 Nov 2018 16:19:52 +0100 Subject: build: Suppress cppcheck errors --- common/test-tests.c | 2 ++ common/test.c | 4 ++++ 2 files changed, 6 insertions(+) (limited to 'common') diff --git a/common/test-tests.c b/common/test-tests.c index ba31d83..2ca1929 100644 --- a/common/test-tests.c +++ b/common/test-tests.c @@ -62,6 +62,7 @@ test_memory (void) mem = malloc (1); assert (mem != NULL); free (mem); + /* cppcheck-suppress deallocuse */ *mem = 1; } } @@ -77,6 +78,7 @@ test_leak (void) assert (mem != NULL); *mem = 1; } + /* cppcheck-suppress memleak */ } int diff --git a/common/test.c b/common/test.c index 18cb501..c88aff1 100644 --- a/common/test.c +++ b/common/test.c @@ -457,6 +457,7 @@ p11_test_directory (const char *prefix) directory, strerror (errno)); free (directory); assert_not_reached (); + return NULL; } free (templ); @@ -483,6 +484,7 @@ p11_test_file_write (const char *base, printf ("# couldn't open file for writing: %s: %s\n", name, strerror (errno)); free (path); assert_not_reached (); + return; } if (fwrite (contents, 1, length, f) != length || @@ -490,6 +492,7 @@ p11_test_file_write (const char *base, printf ("# couldn't write to file: %s: %s\n", name, strerror (errno)); free (path); assert_not_reached (); + return; } free (path); @@ -511,6 +514,7 @@ p11_test_file_delete (const char *base, printf ("# Couldn't delete file: %s\n", name); free (path); assert_not_reached (); + return; } free (path); -- cgit v1.1