[CRIU] [PATCH 15/16] mem/shmem: Use xmalloc in collect_sysv_shmem

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


To get error message in log if no memory available.

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

diff --git a/criu/shmem.c b/criu/shmem.c
index 478d67a69992..1ca1b89320d2 100644
--- a/criu/shmem.c
+++ b/criu/shmem.c
@@ -234,7 +234,7 @@ int collect_sysv_shmem(unsigned long shmid, unsigned long size)
 	 * Tasks will not modify this object, so don't
 	 * shmalloc() as we do it for anon shared mem
 	 */
-	si = malloc(sizeof(*si));
+	si = xmalloc(sizeof(*si));
 	if (!si)
 		return -1;
 
-- 
2.20.1



More information about the CRIU mailing list