From 746f4a61afb81a40cbf8426bdc0b661ce8bc8ee2 Mon Sep 17 00:00:00 2001 From: ip_gpu Date: Mon, 30 Oct 2017 11:37:15 +0500 Subject: [PATCH] fixed from PVS-Studio: V769 The 'pool' pointer in the 'kPageByteSize + pool' expression could be nullptr. In such case, resulting value will be senseless and it should not be used. Check lines: 79, 78. util.h 79 --- util.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util.h b/util.h index 19ab47b..4968047 100644 --- a/util.h +++ b/util.h @@ -76,6 +76,9 @@ static uint8_t *alloc() { if(unlikely(poolEnd<=pool)) { pool = (uint8_t*)malloc(kPageByteSize); + if (!pool) { + sysErrFatal("failed to allocate page"); + } poolEnd = kPageByteSize + pool; } uint8_t *result = pool;