tree-wide: use _cleanup_set_free_ and friends

Instead of _cleanup_(set_freep) or so.
This commit is contained in:
Yu Watanabe
2023-05-28 22:33:44 +09:00
parent 64377c6089
commit 5d2a48da12
52 changed files with 94 additions and 94 deletions

View File

@@ -35,7 +35,7 @@ static int open_passwd_file(const char *root, const char *fname, FILE **ret_file
}
static int populate_uid_cache(const char *root, Hashmap **ret) {
_cleanup_(hashmap_freep) Hashmap *cache = NULL;
_cleanup_hashmap_free_ Hashmap *cache = NULL;
int r;
cache = hashmap_new(&uid_gid_hash_ops);
@@ -76,7 +76,7 @@ static int populate_uid_cache(const char *root, Hashmap **ret) {
}
static int populate_gid_cache(const char *root, Hashmap **ret) {
_cleanup_(hashmap_freep) Hashmap *cache = NULL;
_cleanup_hashmap_free_ Hashmap *cache = NULL;
int r;
cache = hashmap_new(&uid_gid_hash_ops);

View File

@@ -17,7 +17,7 @@ static void test_resolve_one(const char *name) {
log_info("/* %s(\"%s\") */", __func__, name);
_cleanup_(hashmap_freep) Hashmap *uid_cache = NULL, *gid_cache = NULL;
_cleanup_hashmap_free_ Hashmap *uid_cache = NULL, *gid_cache = NULL;
uid_t uid = UID_INVALID;
gid_t gid = GID_INVALID;
int r;

View File

@@ -4055,7 +4055,7 @@ static int read_config_file(
bool ignore_enoent,
bool *invalid_config) {
_cleanup_(hashmap_freep) Hashmap *uid_cache = NULL, *gid_cache = NULL;
_cleanup_hashmap_free_ Hashmap *uid_cache = NULL, *gid_cache = NULL;
_cleanup_fclose_ FILE *_f = NULL;
_cleanup_free_ char *pp = NULL;
unsigned v = 0;