summaryrefslogtreecommitdiff
path: root/src/fstab-generator/fstab-generator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fstab-generator/fstab-generator.c')
-rw-r--r--src/fstab-generator/fstab-generator.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 5dafcba3c0..b75bbb7998 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -511,16 +511,12 @@ static int parse_proc_cmdline_item(const char *key, const char *value) {
} else if (streq(key, "root") && value) {
- free(arg_root_what);
- arg_root_what = strdup(value);
- if (!arg_root_what)
+ if (free_and_strdup(&arg_root_what, value) < 0)
return log_oom();
} else if (streq(key, "rootfstype") && value) {
- free(arg_root_fstype);
- arg_root_fstype = strdup(value);
- if (!arg_root_fstype)
+ if (free_and_strdup(&arg_root_fstype, value) < 0)
return log_oom();
} else if (streq(key, "rootflags") && value) {