diff options
author | David Robillard <d@drobilla.net> | 2025-03-12 08:41:13 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2025-03-16 20:26:22 -0400 |
commit | 21b14df24458f00f520ce514fc7b928f44016fe2 (patch) | |
tree | 2ba9db15a7afc515c04aa78fc257d24a29a6cfe7 /test/test_reader_writer.c | |
parent | 5cbdb2d0563613ffda76fc32f9a6357d3d2bee4b (diff) | |
download | serd-21b14df24458f00f520ce514fc7b928f44016fe2.tar.gz serd-21b14df24458f00f520ce514fc7b928f44016fe2.tar.bz2 serd-21b14df24458f00f520ce514fc7b928f44016fe2.zip |
Check that test values are non-null before use
Diffstat (limited to 'test/test_reader_writer.c')
-rw-r--r-- | test/test_reader_writer.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/test/test_reader_writer.c b/test/test_reader_writer.c index 829caff5..8f432767 100644 --- a/test/test_reader_writer.c +++ b/test/test_reader_writer.c @@ -233,7 +233,9 @@ test_writer(const char* const path) static void test_reader(const char* const path) { - ReaderTest* rt = (ReaderTest*)calloc(1, sizeof(ReaderTest)); + ReaderTest* const rt = (ReaderTest*)calloc(1, sizeof(ReaderTest)); + assert(rt); + SerdReader* reader = serd_reader_new( SERD_TURTLE, rt, free, NULL, NULL, test_statement_sink, NULL); @@ -286,6 +288,7 @@ main(void) const size_t ttl_name_len = strlen(ttl_name); const size_t path_len = tmp_len + 1 + ttl_name_len; char* const path = (char*)calloc(path_len + 1, 1); + assert(path); memcpy(path, tmp, tmp_len + 1); path[tmp_len] = '/'; |