dcavalca / rpms / systemd

Forked from rpms/systemd 3 months ago
Clone
Blob Blame History Raw
From f88dc3edeb9c49622fcc773cb6153238fe9efbe2 Mon Sep 17 00:00:00 2001
From: Tobias Hunger <tobias.hunger@digia.com>
Date: Fri, 3 Oct 2014 20:41:43 -0400
Subject: [PATCH] fstab-generator: Small cleanup

---
 src/fstab-generator/fstab-generator.c | 8 ++------
 1 file 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) {