]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: sessions: Set sess->origin to NULL if the origin was destroyed.
authorOlivier Houchard <ohouchard@haproxy.com>
Fri, 23 Nov 2018 13:50:47 +0000 (14:50 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 23 Nov 2018 13:56:46 +0000 (14:56 +0100)
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

index e464230f3e722aa3231667c9d03cfdf3edb7c4ca..eda2aed11045b9828edd4c5ae82ced27e5d452ca 100644 (file)
@@ -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);