From bba23ba47fda689c974e48b3570fdbfde01e1be7 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Sat, 11 May 2024 20:28:26 +0900 Subject: [PATCH] journal-rate-limit: make journal_ratelimit_group_free() return NULL To make it follow our recent coding style. --- src/journal/journald-rate-limit.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/journal/journald-rate-limit.c b/src/journal/journald-rate-limit.c index ea2c27a686e..25a5d2e92dd 100644 --- a/src/journal/journald-rate-limit.c +++ b/src/journal/journald-rate-limit.c @@ -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) { -- 2.47.3