diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-09-21 12:02:49 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2017-09-23 11:08:57 +0200 |
commit | a12807aaeaf20ff9507cf2c1e338d5c16d528a1e (patch) | |
tree | 91f27e507fee55fb2d21c1b4bb01bb77e4b409b2 /src/test/test-conf-parser.c | |
parent | f858e5148e4f36335555dfaac812197ebd3ef036 (diff) | |
download | systemd-a12807aaeaf20ff9507cf2c1e338d5c16d528a1e.tar.gz |
test-conf-parser: use _cleanup_
Diffstat (limited to 'src/test/test-conf-parser.c')
-rw-r--r-- | src/test/test-conf-parser.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/test/test-conf-parser.c b/src/test/test-conf-parser.c index 81db9d1bd7..cd538f0d40 100644 --- a/src/test/test-conf-parser.c +++ b/src/test/test-conf-parser.c @@ -27,12 +27,10 @@ #include "util.h" static void test_config_parse_path_one(const char *rvalue, const char *expected) { - char *path = NULL; + _cleanup_free_ char *path = NULL; assert_se(config_parse_path("unit", "filename", 1, "section", 1, "lvalue", 0, rvalue, &path, NULL) >= 0); assert_se(streq_ptr(expected, path)); - - free(path); } static void test_config_parse_log_level_one(const char *rvalue, int expected) { @@ -78,12 +76,10 @@ static void test_config_parse_unsigned_one(const char *rvalue, unsigned expected } static void test_config_parse_strv_one(const char *rvalue, char **expected) { - char **strv = 0; + _cleanup_strv_free_ char **strv = NULL; assert_se(config_parse_strv("unit", "filename", 1, "section", 1, "lvalue", 0, rvalue, &strv, NULL) >= 0); assert_se(strv_equal(expected, strv)); - - strv_free(strv); } static void test_config_parse_mode_one(const char *rvalue, mode_t expected) { |