]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: streams: Call tasklet_free() after si_release_endpoint().
authorOlivier Houchard <ohouchard@haproxy.com>
Thu, 18 Oct 2018 14:22:02 +0000 (16:22 +0200)
committerWilly Tarreau <w@1wt.eu>
Sun, 21 Oct 2018 03:59:55 +0000 (05:59 +0200)
Make sure we call tasklet_free() only after si_release_endpoint(), when the
unsubscribe() method has been called, so that we're sure the mux won't
attempt to access the taslet.

src/stream.c

index e202b87e49b148928b9dab51f74a3c7fbbbb6bfb..200556fe42b88dd21e58fa3641110f42278a7444 100644 (file)
@@ -398,12 +398,13 @@ static void stream_free(struct stream *s)
        /* applets do not release session yet */
        must_free_sess = objt_appctx(sess->origin) && sess->origin == s->si[0].end;
 
-       tasklet_free(s->si[0].wait_event.task);
-       tasklet_free(s->si[1].wait_event.task);
 
        si_release_endpoint(&s->si[1]);
        si_release_endpoint(&s->si[0]);
 
+       tasklet_free(s->si[0].wait_event.task);
+       tasklet_free(s->si[1].wait_event.task);
+
        if (must_free_sess)
                session_free(sess);