From: Christopher Faulet Date: Tue, 15 Mar 2022 10:29:59 +0000 (+0100) Subject: BUG/MEDIUM: applet: Don't call .release callback function twice X-Git-Tag: v2.6-dev4~71 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=9affa931cd38bfb7d59ddb4b9906da940258dceb;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: applet: Don't call .release callback function twice Since the CS/SI refactoring, the .release callback function may be called twice. The first call when a shutdown for read or for write is performed. The second one when the applet is detached from its conn-stream. The second call must be guarded, just like the first one, to only be performed is the stream-interface is not the in disconnected (SI_ST_DIS) or closed (SI_ST_CLO) state. To simplify the fix, we now always rely on si_applet_release() function. It is 2.6-specific, no backport is needed. --- diff --git a/src/conn_stream.c b/src/conn_stream.c index df4181c158..86db303612 100644 --- a/src/conn_stream.c +++ b/src/conn_stream.c @@ -129,8 +129,8 @@ void cs_detach_endp(struct conn_stream *cs) } } else if ((appctx = cs_appctx(cs))) { - if (appctx->applet->release) - appctx->applet->release(appctx); + if (cs->si) + si_applet_release(cs->si); appctx_free(appctx); }