From: Zbigniew Jędrzejewski-Szmek Date: Thu, 11 Jul 2019 05:45:13 +0000 (+0200) Subject: test-alloc-util: assert on the return value to appease coverity X-Git-Tag: v243-rc1~142^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=67da2cc883fb261d2f9e5819df5646b2165196a8;p=thirdparty%2Fsystemd.git test-alloc-util: assert on the return value to appease coverity Coverity is right that we should check the return value… CID#1403006. --- diff --git a/src/test/test-alloc-util.c b/src/test/test-alloc-util.c index cf69436d262..71ecda0b992 100644 --- a/src/test/test-alloc-util.c +++ b/src/test/test-alloc-util.c @@ -139,7 +139,7 @@ static void test_auto_erase_memory(void) { assert_se(p1 = new(uint8_t, 1024)); assert_se(p2 = new(uint8_t, 1024)); - genuine_random_bytes(p1, 1024, RANDOM_BLOCK); + assert_se(genuine_random_bytes(p1, 1024, RANDOM_BLOCK) == 0); /* before we exit the scope, do something with this data, so that the compiler won't optimize this away */ memcpy(p2, p1, 1024);