move assertion to top of function. Found by PVS-Studio
authorAlan T. DeKok <aland@freeradius.org>
Wed, 17 May 2017 15:44:48 +0000 (11:44 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Fri, 19 May 2017 18:06:53 +0000 (14:06 -0400)
src/main/process.c

index c3856c7..7b4196c 100644 (file)
@@ -485,6 +485,8 @@ static struct timeval *request_response_window(REQUEST *request)
 {
        VERIFY_REQUEST(request);
 
+       rad_assert(request->home_server != NULL);
+
        if (request->client) {
                /*
                 *      The client hasn't set the response window.  Return
@@ -500,7 +502,6 @@ static struct timeval *request_response_window(REQUEST *request)
                }
        }
 
-       rad_assert(request->home_server != NULL);
        return &request->home_server->response_window;
 }