summaryrefslogtreecommitdiff
path: root/src/network/test-routing-policy-rule.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-11-27 12:01:41 +0000
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2017-11-28 09:25:38 +0100
commit93f9da6e0a9e701e4532056754c2d867e86d8dd6 (patch)
tree2e66ae60a56dbd043eb6abd2e7e4884093ed6e82 /src/network/test-routing-policy-rule.c
parent9491f55f74a1c61a8c6c79c3ef16a32f2722e232 (diff)
downloadsystemd-93f9da6e0a9e701e4532056754c2d867e86d8dd6.tar.gz
networkd: plug some memleaks in rule serialization/deserialization
This fixes the (mostly theoretical, since we're only parsing data that we write ourselves) memleak when iif or oif is deserialized multiple times. Unfortunately it does not fix the memleak when rule is freed, but that'll require a bigger effort.
Diffstat (limited to 'src/network/test-routing-policy-rule.c')
-rw-r--r--src/network/test-routing-policy-rule.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/network/test-routing-policy-rule.c b/src/network/test-routing-policy-rule.c
index c619dbc159..fc6eb5626d 100644
--- a/src/network/test-routing-policy-rule.c
+++ b/src/network/test-routing-policy-rule.c
@@ -96,5 +96,9 @@ int main(int argc, char **argv) {
test_rule_serialization("outgoing interface",
"RULE=from=1::2/64 to=2::3/64 oif=eth0 table=1", NULL);
+ test_rule_serialization("freeing interface names",
+ "RULE=from=1::2/64 to=2::3/64 iif=e0 iif=e1 oif=e0 oif=e1 table=1",
+ "RULE=from=1::2/64 to=2::3/64 iif=e1 oif=e1 table=1");
+
return 0;
}