network: drop unnecessary strdup()
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 8 Mar 2019 05:42:42 +0000 (14:42 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 21 Mar 2019 14:37:39 +0000 (23:37 +0900)
src/libsystemd-network/network-internal.c

index c8fc10d..63d4d85 100644 (file)
@@ -159,7 +159,6 @@ int config_parse_net_condition(const char *unit,
         Condition **ret = data;
         bool negate;
         Condition *c;
-        _cleanup_free_ char *s = NULL;
 
         assert(filename);
         assert(lvalue);
@@ -170,11 +169,7 @@ int config_parse_net_condition(const char *unit,
         if (negate)
                 rvalue++;
 
-        s = strdup(rvalue);
-        if (!s)
-                return log_oom();
-
-        c = condition_new(cond, s, false, negate);
+        c = condition_new(cond, rvalue, false, negate);
         if (!c)
                 return log_oom();