]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: sink: remove useless cleanup in sink_new_from_logger()
authorAurelien DARRAGON <adarragon@haproxy.com>
Wed, 4 Jun 2025 14:51:04 +0000 (16:51 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Thu, 5 Jun 2025 07:58:50 +0000 (09:58 +0200)
As reported by Ilya in GH #2994, some cleanup parts in
sink_new_from_logger() function are not used.

We can actually simplify the cleanup logic to remove dead code, let's
do that by renaming "error_final" label to "error" and only making use
of the "error" label, because sink_free() already takes care of proper
cleanup for all sink members.

src/sink.c

index b05e55dad95f8a4fcd17f59bb4949e188b6ba924..0ed32c25240d82d6956bebae3b7786e1011b858b 100644 (file)
@@ -1268,15 +1268,11 @@ struct sink *sink_new_from_logger(struct logger *logger)
        HA_SPIN_INIT(&srv->lock);
 
        if (sink_finalize(sink) & ERR_CODE)
-               goto error_final;
+               goto error;
 
        return sink;
- error:
-       if (srv)
-               srv_detach(srv);
-       srv_drop(srv);
 
- error_final:
+ error:
        sink_free(sink);
 
        return NULL;