[CRIU] [PATCH 07/13] socket: handle errors of xmalloc
Andrey Vagin
avagin at openvz.org
Wed Apr 3 13:31:06 EDT 2013
Signed-off-by: Andrey Vagin <avagin at openvz.org>
---
sockets.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sockets.c b/sockets.c
index 47134d4..eb17409 100644
--- a/sockets.c
+++ b/sockets.c
@@ -121,6 +121,8 @@ static int dump_bound_dev(int sk, SkOptsEntry *soe)
pr_debug("\tDumping %s bound dev for sk\n", dev);
soe->so_bound_dev = xmalloc(len);
+ if (soe->so_bound_dev == NULL)
+ return -1;
strcpy(soe->so_bound_dev, dev);
return 0;
}
--
1.7.11.7
More information about the CRIU
mailing list