summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2023-04-24 20:48:33 +0200
committerDavid Tardon <dtardon@redhat.com>2023-04-24 21:15:50 +0200
commit8f25d740f19a7475efe5cd60aafe5d6231e8be8b (patch)
tree4036f857f4c15b13ba173cfc9e51e4264b12eb4e
parenttest-calendarspec: use _cleanup_ (diff)
downloadsystemd-8f25d740f19a7475efe5cd60aafe5d6231e8be8b.tar.xz
systemd-8f25d740f19a7475efe5cd60aafe5d6231e8be8b.zip
test-set: use _cleanup_
-rw-r--r--src/test/test-set.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/test/test-set.c b/src/test/test-set.c
index 304e3db6c9..259ffa7ce2 100644
--- a/src/test/test-set.c
+++ b/src/test/test-set.c
@@ -145,7 +145,8 @@ TEST(set_ensure_allocated) {
}
TEST(set_copy) {
- Set *s, *copy;
+ _cleanup_(set_freep) Set *s = NULL;
+ _cleanup_(set_free_freep) Set *copy = NULL;
char *key1, *key2, *key3, *key4;
key1 = strdup("key1");
@@ -169,9 +170,6 @@ TEST(set_copy) {
assert_se(copy);
assert_se(set_equal(s, copy));
-
- set_free(s);
- set_free_free(copy);
}
TEST(set_ensure_put) {