network: use structured initializer at one more place
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 26 Sep 2018 16:52:04 +0000 (01:52 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 27 Sep 2018 08:48:34 +0000 (17:48 +0900)
src/network/networkd-routing-policy-rule.c

index 588e618..afa1449 100644 (file)
 int routing_policy_rule_new(RoutingPolicyRule **ret) {
         RoutingPolicyRule *rule;
 
-        rule = new0(RoutingPolicyRule, 1);
+        rule = new(RoutingPolicyRule, 1);
         if (!rule)
                 return -ENOMEM;
 
-        rule->family = AF_INET;
-        rule->table = RT_TABLE_MAIN;
+        *rule = (RoutingPolicyRule) {
+                .family = AF_INET,
+                .table = RT_TABLE_MAIN,
+        };
 
         *ret = rule;
         return 0;