Skip to content

Commit

Permalink
build: Simplify assertions
Browse files Browse the repository at this point in the history
Let it leak memory when we assert, so not to confuse static analyzers
as if this is the normal case.
  • Loading branch information
ueno committed Nov 23, 2018
1 parent b92e8c7 commit b9eceda
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions common/test.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,17 +482,13 @@ p11_test_file_write (const char *base,
f = fopen (name, "wb");
if (f == NULL) {
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 ||
fclose (f) != 0) {
printf ("# couldn't write to file: %s: %s\n", name, strerror (errno));
free (path);
assert_not_reached ();
return;
}

free (path);
Expand All @@ -512,9 +508,7 @@ p11_test_file_delete (const char *base,

if (unlink (name) < 0) {
printf ("# Couldn't delete file: %s\n", name);
free (path);
assert_not_reached ();
return;
}

free (path);
Expand Down

0 comments on commit b9eceda

Please sign in to comment.