From 25607afa0ad3158d06acfcd936a2bd850043773f Mon Sep 17 00:00:00 2001 From: Olivier Houchard Date: Fri, 23 Nov 2018 14:50:47 +0100 Subject: [PATCH] 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(). --- src/stream.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/stream.c b/src/stream.c index e464230f3..eda2aed11 100644 --- a/src/stream.c +++ b/src/stream.c @@ -434,8 +434,10 @@ static void stream_free(struct stream *s) tasklet_free(s->si[0].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); + } pool_free(pool_head_stream, s);