]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test: make the copied set not take the ownership of elements
authorYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 11 Apr 2025 03:00:51 +0000 (12:00 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Fri, 18 Apr 2025 00:16:44 +0000 (09:16 +0900)
src/test/test-set.c

index 19b46a529fa9aa94cc1914f57e86b7e4fb2e1b39..8411e478eb313dabaab893abc9ddbd8214babbbd 100644 (file)
@@ -145,9 +145,8 @@ TEST(set_ensure_allocated) {
 }
 
 TEST(set_copy) {
-        _cleanup_set_free_ Set *s = NULL;
-        _cleanup_set_free_free_ Set *copy = NULL;
-        char *key1, *key2, *key3, *key4;
+        _cleanup_set_free_ Set *s = NULL, *copy = NULL;
+        _cleanup_free_ char *key1 = NULL, *key2 = NULL, *key3 = NULL, *key4 = NULL;
 
         key1 = strdup("key1");
         assert_se(key1);