]> git.ipfire.org Git - thirdparty/systemd.git/blobdiff - src/test/test-unit-file.c
tree-wide: drop license boilerplate
[thirdparty/systemd.git] / src / test / test-unit-file.c
index 40eeba6af5c07d513ecc413c4a0a2e1e9fb41122..84b20267ad3c7a5e978e574007fe49f0cf77d439 100644 (file)
@@ -4,19 +4,6 @@
 
   Copyright 2012 Lennart Poettering
   Copyright 2013 Zbigniew Jędrzejewski-Szmek
-
-  systemd is free software; you can redistribute it and/or modify it
-  under the terms of the GNU Lesser General Public License as published by
-  the Free Software Foundation; either version 2.1 of the License, or
-  (at your option) any later version.
-
-  systemd is distributed in the hope that it will be useful, but
-  WITHOUT ANY WARRANTY; without even the implied warranty of
-  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-  Lesser General Public License for more details.
-
-  You should have received a copy of the GNU Lesser General Public License
-  along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
 #include <fcntl.h>
@@ -113,8 +100,8 @@ static void test_config_parse_exec(void) {
 
         ExecCommand *c = NULL, *c1;
         const char *ccc;
-        Manager *m = NULL;
-        Unit *u = NULL;
+        _cleanup_(manager_freep) Manager *m = NULL;
+        _cleanup_(unit_freep) Unit *u = NULL;
 
         r = manager_new(UNIT_FILE_USER, MANAGER_TEST_RUN_MINIMAL, &m);
         if (MANAGER_SKIP_TEST(r)) {
@@ -441,9 +428,6 @@ static void test_config_parse_exec(void) {
         assert_se(c == NULL);
 
         exec_command_free_list(c);
-
-        unit_free(u);
-        manager_free(m);
 }
 
 static void test_config_parse_log_extra_fields(void) {
@@ -461,8 +445,8 @@ static void test_config_parse_log_extra_fields(void) {
 
         int r;
 
-        Manager *m = NULL;
-        Unit *u = NULL;
+        _cleanup_(manager_freep) Manager *m = NULL;
+        _cleanup_(unit_freep) Unit *u = NULL;
         ExecContext c = {};
 
         r = manager_new(UNIT_FILE_USER, MANAGER_TEST_RUN_MINIMAL, &m);
@@ -507,9 +491,6 @@ static void test_config_parse_log_extra_fields(void) {
 
         exec_context_free_log_extra_fields(&c);
 
-        unit_free(u);
-        manager_free(m);
-
         log_info("/* %s – bye */", __func__);
 }