From: Yu Watanabe Date: Sat, 12 Apr 2025 16:10:29 +0000 (+0900) Subject: socket-proxy: make connection_free() return NULL X-Git-Tag: v258-rc1~832^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=234b86a44481895f405822bb4ae5f56938b2d3f6;p=thirdparty%2Fsystemd.git socket-proxy: make connection_free() return NULL To make it follow our coding style. --- diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c index 3a1e9b19616..40bdfe070e0 100644 --- a/src/socket-proxy/socket-proxyd.c +++ b/src/socket-proxy/socket-proxyd.c @@ -59,8 +59,9 @@ typedef struct Connection { sd_resolve_query *resolve_query; } Connection; -static void connection_free(Connection *c) { - assert(c); +static Connection* connection_free(Connection *c) { + if (!c) + return NULL; if (c->context) set_remove(c->context->connections, c); @@ -76,7 +77,7 @@ static void connection_free(Connection *c) { sd_resolve_query_unref(c->resolve_query); - free(c); + return mfree(c); } static int idle_time_cb(sd_event_source *s, uint64_t usec, void *userdata) {