]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
socket-proxy: make connection_free() return NULL
authorYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 12 Apr 2025 16:10:29 +0000 (01:10 +0900)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Sat, 12 Apr 2025 19:28:35 +0000 (04:28 +0900)
To make it follow our coding style.

src/socket-proxy/socket-proxyd.c

index 3a1e9b196169a5473be0b9f83e8acef4d6e252a9..40bdfe070e04fa4335bffd445a973bec8aeaec45 100644 (file)
@@ -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) {