mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-12 09:17:44 +03:00
journal: make mmap_cache_unref() a NOP when NULL is passed, like all other destructors
This commit is contained in:
parent
9eae2bf318
commit
f649045c10
@ -169,8 +169,7 @@ JournalFile* journal_file_close(JournalFile *f) {
|
||||
safe_close(f->fd);
|
||||
free(f->path);
|
||||
|
||||
if (f->mmap)
|
||||
mmap_cache_unref(f->mmap);
|
||||
mmap_cache_unref(f->mmap);
|
||||
|
||||
ordered_hashmap_free_free(f->chain_cache);
|
||||
|
||||
|
@ -348,7 +348,10 @@ static void mmap_cache_free(MMapCache *m) {
|
||||
}
|
||||
|
||||
MMapCache* mmap_cache_unref(MMapCache *m) {
|
||||
assert(m);
|
||||
|
||||
if (!m)
|
||||
return NULL;
|
||||
|
||||
assert(m->n_ref > 0);
|
||||
|
||||
m->n_ref --;
|
||||
|
Loading…
Reference in New Issue
Block a user