test-alloc-util: assert on the return value to appease coverity
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 11 Jul 2019 05:45:13 +0000 (07:45 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 11 Jul 2019 09:19:19 +0000 (11:19 +0200)
Coverity is right that we should check the return value…
CID#1403006.

src/test/test-alloc-util.c

index cf69436..71ecda0 100644 (file)
@@ -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);