]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Don't assert state quite so soon
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Sat, 29 May 2021 01:16:00 +0000 (02:16 +0100)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 31 May 2021 12:27:23 +0000 (08:27 -0400)
If we're injecting a fake cleanup packet then state will already
be set. However there will be no State attribute, which will let
this quit early.

src/main/state.c

index 15a19458e48ffe9800d569390145692a6385f896..c04db0bc025079c5bfd4dda758e6d88f6b42b264 100644 (file)
@@ -438,8 +438,6 @@ void fr_state_get_vps(REQUEST *request, RADIUS_PACKET *packet)
        fr_state_t *state = &global_state;
        TALLOC_CTX *old_ctx = NULL;
 
-       rad_assert(request->state == NULL);
-
        /*
         *      No State, don't do anything.
         */
@@ -448,6 +446,8 @@ void fr_state_get_vps(REQUEST *request, RADIUS_PACKET *packet)
                return;
        }
 
+       rad_assert(request->state == NULL);
+
        PTHREAD_MUTEX_LOCK(&state->mutex);
        entry = fr_state_find(state, request->server, packet);