From d98c19ef0edcc426dcf9a496b56bf6dbe2a40b08 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Mon, 7 Nov 2016 13:37:49 -0800 Subject: [PATCH] Use xstrdup whether possible Using xstrdup lets us have an error message printed if malloc() fails. travis-ci: success for Assorted nitpicks Signed-off-by: Kir Kolyshkin Signed-off-by: Pavel Emelyanov --- criu/files-reg.c | 2 +- criu/plugin.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/criu/files-reg.c b/criu/files-reg.c index 03a7bcc52..1c3d32e0c 100644 --- a/criu/files-reg.c +++ b/criu/files-reg.c @@ -81,7 +81,7 @@ static int note_link_remap(char *path, struct ns_id *nsid) if (!rlb) goto err; - rlb->path = strdup(path); + rlb->path = xstrdup(path); if (!rlb->path) goto err2; diff --git a/criu/plugin.c b/criu/plugin.c index 387b11f5e..6d9511857 100644 --- a/criu/plugin.c +++ b/criu/plugin.c @@ -29,7 +29,7 @@ static cr_plugin_desc_t *cr_gen_plugin_desc(void *h, char *path) if (!d) return NULL; - d->name = strdup(path); + d->name = xstrdup(path); d->max_hooks = CR_PLUGIN_HOOK__MAX; d->version = CRIU_PLUGIN_VERSION_OLD;