[CRIU] [PATCH 4/9] mount.c: use xstrdup()

Kir Kolyshkin kir at openvz.org
Mon Nov 7 13:37:48 PST 2016


We already have a wrapper that spits out an error, use it.

Signed-off-by: Kir Kolyshkin <kir at openvz.org>
---
 criu/mount.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/criu/mount.c b/criu/mount.c
index eea1a8a..37cfdd4 100644
--- a/criu/mount.c
+++ b/criu/mount.c
@@ -2275,11 +2275,9 @@ static int create_mnt_roots(void)
 		goto out;
 	}
 
-	mnt_roots = strdup(".criu.mntns.XXXXXX");
-	if (mnt_roots == NULL) {
-		pr_perror("Can't allocate memory");
+	mnt_roots = xstrdup(".criu.mntns.XXXXXX");
+	if (mnt_roots == NULL)
 		goto out;
-	}
 
 	if (mkdtemp(mnt_roots) == NULL) {
 		pr_perror("Unable to create a temporary directory");
-- 
2.7.4



More information about the CRIU mailing list