diff --git a/src/util-io.c b/src/util-io.c index 237114e..ad5b82a 100644 --- a/src/util-io.c +++ b/src/util-io.c @@ -703,6 +703,7 @@ MUNIT_TEST(test_iobuf_append_fd) MUNIT_TEST(test_iobuf_append_fd_too_many) { _cleanup_fclose_ FILE *fp = tmpfile(); + munit_assert_ptr_not_null(fp); int fd = fileno(fp); _cleanup_iobuf_ struct iobuf *buf = iobuf_new(20); @@ -732,6 +733,7 @@ MUNIT_TEST(test_iobuf_recv_fd) _cleanup_close_ int left = fds[0]; _cleanup_close_ int right = fds[1]; _cleanup_fclose_ FILE *fp = tmpfile(); + munit_assert_ptr_not_null(fp); /* actual message data to be sent */ char data[] = "some data\n"; @@ -782,7 +784,9 @@ MUNIT_TEST(test_pass_fd) /* Write some data to the file on it's real fd */ for (size_t idx = 0; idx < ARRAY_LENGTH(fps); idx++) { _cleanup_free_ char *buf = xaprintf("foo %zu\n", idx); + munit_assert_ptr_not_null(buf); FILE *fp = fps[idx]; + munit_assert_ptr_not_null(fp); fwrite(buf, strlen(buf) + 1, 1, fp); fflush(fp); } diff --git a/src/util-sources.c b/src/util-sources.c index a3f8496..623f3a8 100644 --- a/src/util-sources.c +++ b/src/util-sources.c @@ -239,6 +239,7 @@ source_enable_write(struct source *source, bool enable) MUNIT_TEST(test_sink) { struct sink *sink = sink_new(); + munit_assert_ptr_not_null(sink); sink_dispatch(sink); sink_dispatch(sink); diff --git a/src/util-strings.c b/src/util-strings.c index d55f774..b721bd9 100644 --- a/src/util-strings.c +++ b/src/util-strings.c @@ -427,6 +427,7 @@ MUNIT_TEST(test_strstrip) while (t->string) { char *str; str = strstrip(t->string, t->what); + munit_assert_ptr_not_null(str); munit_assert_string_equal(str, t->expected); free(str); t++; @@ -521,6 +522,7 @@ MUNIT_TEST(test_cmdline_as_str) munit_assert_int(len, >=, 0); cmdline[len] = '\0'; + munit_assert_ptr_not_null(from_function); munit_assert_string_equal(cmdline, from_function); return MUNIT_OK;