]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal-rate-limit: make journal_ratelimit_group_free() return NULL
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 11 May 2024 11:28:26 +0000 (20:28 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sun, 12 May 2024 01:32:14 +0000 (10:32 +0900)
To make it follow our recent coding style.

src/journal/journald-rate-limit.c

index ea2c27a686e0dc293f2d2713da32b8ad7c4913be..25a5d2e92ddb53c1c49b634ef80f7082471b5501 100644 (file)
@@ -72,8 +72,9 @@ JournalRateLimit *journal_ratelimit_new(void) {
         return r;
 }
 
-static void journal_ratelimit_group_free(JournalRateLimitGroup *g) {
-        assert(g);
+static JournalRateLimitGroup* journal_ratelimit_group_free(JournalRateLimitGroup *g) {
+        if (!g)
+                return NULL;
 
         if (g->parent) {
                 assert(g->parent->n_groups > 0);
@@ -88,7 +89,7 @@ static void journal_ratelimit_group_free(JournalRateLimitGroup *g) {
         }
 
         free(g->id);
-        free(g);
+        return mfree(g);
 }
 
 void journal_ratelimit_free(JournalRateLimit *r) {