From 67da2cc883fb261d2f9e5819df5646b2165196a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 11 Jul 2019 07:45:13 +0200 Subject: [PATCH] test-alloc-util: assert on the return value to appease coverity MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Coverity is right that we should check the return value… CID#1403006. --- src/test/test-alloc-util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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);