summaryrefslogtreecommitdiff
path: root/src/nspawn/nspawn.c
diff options
context:
space:
mode:
authorDaniel Mack <daniel@zonque.org>2015-07-29 20:25:57 +0200
committerDaniel Mack <daniel@zonque.org>2015-07-30 13:09:01 +0200
commit2fc09a9cdd1ad25bc7c53a23d5301eb952e1ce3d (patch)
treec662c5bf209dae93822ac07a831882a7ba4ba0b2 /src/nspawn/nspawn.c
parent5f17089ac1e86c25806d3f066243561360efd2ca (diff)
tree-wide: use free_and_strdup()
Use free_and_strdup() where appropriate and replace equivalent, open-coded versions.
Diffstat (limited to 'src/nspawn/nspawn.c')
-rw-r--r--src/nspawn/nspawn.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 65b9a5071b..d46f768cfa 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -503,9 +503,8 @@ static int parse_argv(int argc, char *argv[]) {
break;
case 'u':
- free(arg_user);
- arg_user = strdup(optarg);
- if (!arg_user)
+ r = free_and_strdup(&arg_user, optarg);
+ if (r < 0)
return log_oom();
break;