summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorDaiki Ueno <dueno@redhat.com>2018-11-22 16:19:52 +0100
committerDaiki Ueno <ueno@gnu.org>2018-11-22 18:17:17 +0100
commitf0c82b07f8b31a4b86de32436cb4f5053de16336 (patch)
treeebd98235e60db5b9c242e7a04ca0881e1191f78a /common
parent8287689158403090b5828a568b122b5b3a3ce987 (diff)
build: Suppress cppcheck errors
Diffstat (limited to 'common')
-rw-r--r--common/test-tests.c2
-rw-r--r--common/test.c4
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);