MINOR: vars: make get_vars() allow the session to be null

In order to support manipulating variables from outside a session,
let's make get_vars() not assume that the session is always set.
This commit is contained in:
Willy Tarreau 2021-03-26 11:27:59 +01:00
parent 704ba1d63e
commit a07d61be4c

View File

@ -47,7 +47,7 @@ static inline struct vars *get_vars(struct session *sess, struct stream *strm, e
case SCOPE_PROC:
return &global.vars;
case SCOPE_SESS:
return &sess->vars;
return sess ? &sess->vars : NULL;
case SCOPE_CHECK: {
struct check *check = objt_check(sess->origin);