From: David Tardon Date: Fri, 3 Feb 2023 12:50:11 +0000 (+0100) Subject: bus-polkit: return NULL from _free function X-Git-Tag: v254-rc1~173^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc8187f75a73b8c3d8f724b7cc98d3b0b8e27c21;p=thirdparty%2Fsystemd.git bus-polkit: return NULL from _free function --- diff --git a/src/shared/bus-polkit.c b/src/shared/bus-polkit.c index 4b9f8410b31..db2801d7a4f 100644 --- a/src/shared/bus-polkit.c +++ b/src/shared/bus-polkit.c @@ -165,9 +165,9 @@ typedef struct AsyncPolkitQuery { sd_event_source *defer_event_source; } AsyncPolkitQuery; -static void async_polkit_query_free(AsyncPolkitQuery *q) { +static AsyncPolkitQuery *async_polkit_query_free(AsyncPolkitQuery *q) { if (!q) - return; + return NULL; sd_bus_slot_unref(q->slot); @@ -181,7 +181,8 @@ static void async_polkit_query_free(AsyncPolkitQuery *q) { strv_free(q->details); sd_event_source_disable_unref(q->defer_event_source); - free(q); + + return mfree(q); } static int async_polkit_defer(sd_event_source *s, void *userdata) {