]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: haproxy: always protocol unbind on startup error path
authorAurelien DARRAGON <adarragon@haproxy.com>
Tue, 17 Jan 2023 15:30:52 +0000 (16:30 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 23 Feb 2023 14:05:05 +0000 (15:05 +0100)
In haproxy startup, all init error paths after the protocol bind step
cautiously call protocol_unbind_all() before exiting except one that was
conditional. We're not making an exception to the rule and we now properly
call protocol_unbind_all() as well.

No backport needed as this patch is unnoticeable.

src/haproxy.c

index 308f41873ccaa97b2ea89d4c62eb38e4ad616feb..a1399f9dc0d84d2ec154b14fd4fa2660288889ef 100644 (file)
@@ -3381,10 +3381,9 @@ int main(int argc, char **argv)
        /* Note: protocol_bind_all() sends an alert when it fails. */
        if ((err & ~ERR_WARN) != ERR_NONE) {
                ha_alert("[%s.main()] Some protocols failed to start their listeners! Exiting.\n", argv[0]);
-               if (retry != MAX_START_RETRIES && nb_oldpids) {
-                       protocol_unbind_all(); /* cleanup everything we can */
+               if (retry != MAX_START_RETRIES && nb_oldpids)
                        tell_old_pids(SIGTTIN);
-               }
+               protocol_unbind_all(); /* cleanup everything we can */
                exit(1);
        }