diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-28 13:02:33 +0100 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-11-28 21:34:50 +0100 |
commit | b921fcb2acbcac7535b3d38e27384f86c51bcbbb (patch) | |
tree | a5d56193ebbe5db0f93e4b7f3c5f62d6f2df134b /src/network/test-routing-policy-rule.c | |
parent | f916819053ff78a215d591a8cf5a873fafeb84f0 (diff) | |
download | systemd-b921fcb2acbcac7535b3d38e27384f86c51bcbbb.tar.gz |
networkd: fix memleak of Rules
This was the issue mentioned in 93f9da6e0a.
Diffstat (limited to 'src/network/test-routing-policy-rule.c')
-rw-r--r-- | src/network/test-routing-policy-rule.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/network/test-routing-policy-rule.c b/src/network/test-routing-policy-rule.c index fc6eb5626d..c29d134de2 100644 --- a/src/network/test-routing-policy-rule.c +++ b/src/network/test-routing-policy-rule.c @@ -34,7 +34,7 @@ static void test_rule_serialization(const char *title, const char *ruleset, cons const char *cmd; int fd, fd2, fd3; _cleanup_fclose_ FILE *f = NULL, *f2 = NULL, *f3 = NULL; - _cleanup_set_free_free_ Set *rules = NULL; + Set *rules = NULL; _cleanup_free_ char *buf = NULL; size_t buf_size; @@ -64,6 +64,8 @@ static void test_rule_serialization(const char *title, const char *ruleset, cons cmd = strjoina("diff -u ", pattern3, " ", pattern2); log_info("$ %s", cmd); assert_se(system(cmd) == 0); + + set_free_with_destructor(rules, routing_policy_rule_free); } int main(int argc, char **argv) { |