[systemd-devel] [PATCH] Small cleanup for systemd-fstab-generator

Tobias Hunger tobias.hunger at gmail.com
Fri Oct 3 07:53:47 PDT 2014


 From 4d038e78cd9656712a74901e0b6c79184764e7c1 Mon Sep 17 00:00:00 2001
 From: Tobias Hunger <tobias.hunger at digia.com>
Date: Fri, 3 Oct 2014 16:29:30 +0200
Subject: [PATCH 1/2] 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 5dafcba..b75bbb7 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) {
-- 
2.0.1


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20141003/5938feeb/attachment.html>


More information about the systemd-devel mailing list