Use hashmap_free_free where appropriate

This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-11-28 12:31:27 +01:00
parent fbdb6605b5
commit ec1d290903
2 changed files with 2 additions and 8 deletions

View File

@ -1978,7 +1978,6 @@ fail:
_public_ void sd_journal_close(sd_journal *j) {
Directory *d;
JournalFile *f;
char *p;
if (!j)
return;
@ -2006,9 +2005,7 @@ _public_ void sd_journal_close(sd_journal *j) {
mmap_cache_unref(j->mmap);
}
while ((p = hashmap_steal_first(j->errors)))
free(p);
hashmap_free(j->errors);
hashmap_free_free(j->errors);
free(j->path);
free(j->prefix);

View File

@ -97,10 +97,7 @@ static void test_mnt_id(void) {
assert_se(path_equal_ptr(hashmap_get(h, INT_TO_PTR(mnt_id2)), p));
}
while ((p = hashmap_steal_first(h)))
free(p);
hashmap_free(h);
hashmap_free_free(h);
}
int main(int argc, char *argv[]) {