diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/test-tests.c | 2 | ||||
-rw-r--r-- | common/test.c | 4 |
2 files changed, 6 insertions, 0 deletions
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); |