2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-08-30 13:58:34 +00:00

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 <kir@openvz.org>
Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
Kir Kolyshkin
2016-11-07 13:37:49 -08:00
committed by Pavel Emelyanov
parent 9f06405082
commit d98c19ef0e
2 changed files with 2 additions and 2 deletions

View File

@@ -81,7 +81,7 @@ static int note_link_remap(char *path, struct ns_id *nsid)
if (!rlb) if (!rlb)
goto err; goto err;
rlb->path = strdup(path); rlb->path = xstrdup(path);
if (!rlb->path) if (!rlb->path)
goto err2; goto err2;

View File

@@ -29,7 +29,7 @@ static cr_plugin_desc_t *cr_gen_plugin_desc(void *h, char *path)
if (!d) if (!d)
return NULL; return NULL;
d->name = strdup(path); d->name = xstrdup(path);
d->max_hooks = CR_PLUGIN_HOOK__MAX; d->max_hooks = CR_PLUGIN_HOOK__MAX;
d->version = CRIU_PLUGIN_VERSION_OLD; d->version = CRIU_PLUGIN_VERSION_OLD;