]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-journal: use hash ops with destructor
authorYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 22 Jan 2025 01:39:35 +0000 (10:39 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 23 Jan 2025 09:19:28 +0000 (18:19 +0900)
src/libsystemd/sd-journal/sd-journal.c

index 858aeca45efc70a7fbe32ec6966b5f007be26c20..83f77206c3153dde167e37a80fbb94117d855496 100644 (file)
@@ -83,7 +83,7 @@ static int journal_put_error(sd_journal *j, int r, const char *path) {
                         return -ENOMEM;
         }
 
-        r = hashmap_ensure_put(&j->errors, NULL, INT_TO_PTR(r), copy);
+        r = hashmap_ensure_put(&j->errors, &trivial_hash_ops_value_free, INT_TO_PTR(r), copy);
         if (r == -EEXIST)
                 return 0;
         if (r < 0)
@@ -2560,7 +2560,7 @@ _public_ void sd_journal_close(sd_journal *j) {
         if (j->mmap)
                 mmap_cache_unref(j->mmap);
 
-        hashmap_free_free(j->errors);
+        hashmap_free(j->errors);
 
         set_free(j->exclude_syslog_identifiers);