From: Yu Watanabe Date: Sat, 11 May 2024 11:28:26 +0000 (+0900) Subject: journal-rate-limit: make journal_ratelimit_group_free() return NULL X-Git-Tag: v256-rc2~35^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bba23ba47fda689c974e48b3570fdbfde01e1be7;p=thirdparty%2Fsystemd.git journal-rate-limit: make journal_ratelimit_group_free() return NULL To make it follow our recent coding style. --- 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) {