]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: backend: Don't allow to change backend applet
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Apr 2022 08:28:30 +0000 (10:28 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 22 Apr 2022 12:14:27 +0000 (14:14 +0200)
This part was inherited from haproxy-1.5. But since a while (at least 1.8),
the backend applet, once created, is no longer changed. Thus there is no
reason to still check if the target has changed. And in fact, if it was
still possible, there would be a memory leak because the old applet would be
lost and never released.

There is no reason to backport this fix because the leak only exists on a
dead code path.

src/backend.c

index 8255ffbe7239af215ed916c30fb15442c62eba88..12f9a651b64be9db46335a2343e15f40ad7c0b53 100644 (file)
@@ -2129,7 +2129,7 @@ void back_handle_st_req(struct stream *s)
                /* the applet directly goes to the EST state */
                struct appctx *appctx = cs_appctx(s->csb);
 
-               if (!appctx || appctx->applet != __objt_applet(s->target))
+               if (!appctx)
                        appctx = cs_applet_create(cs, objt_applet(s->target));
 
                if (!appctx) {