[CRIU] [PATCH 13/16] mem/shmem: Use xrealloc_safe in expand_shmem

Cyrill Gorcunov gorcunov at gmail.com
Fri Jul 5 18:38:08 MSK 2019


Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 criu/shmem.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/criu/shmem.c b/criu/shmem.c
index 03b088f268a9..da9242674291 100644
--- a/criu/shmem.c
+++ b/criu/shmem.c
@@ -197,8 +197,7 @@ static int expand_shmem(struct shmem_info *si, unsigned long new_size)
 
 	BUG_ON(new_map_size < map_size);
 
-	si->pstate_map = xrealloc(si->pstate_map, new_map_size);
-	if (!si->pstate_map)
+	if (xrealloc_safe(&si->pstate_map, new_map_size))
 		return -1;
 	memzero(si->pstate_map + nr_map_items, new_map_size - map_size);
 	return 0;
-- 
2.20.1



More information about the CRIU mailing list