BUG/MEDIUM: sessions: Set sess->origin to NULL if the origin was destroyed.

When ending a stream, if the origin is an appctx, the appctx will have been
destroyed already, but it does not destroy the session. So later, when we
try to destroy the session, we try to dereference sess->origin and die
trying.
Fix this by explicitely setting sess->origin to NULL before calling
session_free().
This commit is contained in:
Olivier Houchard 2018-11-23 14:50:47 +01:00 committed by Willy Tarreau
parent 1295016873
commit 25607afa0a

View File

@ -434,8 +434,10 @@ static void stream_free(struct stream *s)
tasklet_free(s->si[0].wait_event.task); tasklet_free(s->si[0].wait_event.task);
tasklet_free(s->si[1].wait_event.task); tasklet_free(s->si[1].wait_event.task);
if (must_free_sess) if (must_free_sess) {
sess->origin = NULL;
session_free(sess); session_free(sess);
}
pool_free(pool_head_stream, s); pool_free(pool_head_stream, s);