]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
don't leave dangling pointer to a cancelled coa request
authorMatthew Newton <matthew-git@newtoncomputing.co.uk>
Tue, 8 Aug 2023 18:43:50 +0000 (19:43 +0100)
committerMatthew Newton <matthew-git@newtoncomputing.co.uk>
Tue, 8 Aug 2023 22:43:48 +0000 (23:43 +0100)
src/main/process.c

index f3a8f86cf219ea346f70265fcee0f02a8f749586..50312d6b7f0dd757bf268c1076440945cf215b19 100644 (file)
@@ -3250,7 +3250,11 @@ do_home:
         *      Once we've decided to proxy a request, we cannot send
         *      a CoA packet.  So we free up any CoA packet here.
         */
-       if (request->coa) request_done(request->coa, FR_ACTION_COA_CANCELLED);
+       if (request->coa) {
+               RWDEBUG("Cannot proxy and originate CoA packets at the same time.  Cancelling CoA request");
+               request_done(request->coa, FR_ACTION_COA_CANCELLED);
+               request->coa = NULL;
+       }
 #endif
 
        /*
@@ -3467,6 +3471,7 @@ static int request_proxy(REQUEST *request)
        if (request->coa) {
                RWDEBUG("Cannot proxy and originate CoA packets at the same time.  Cancelling CoA request");
                request_done(request->coa, FR_ACTION_COA_CANCELLED);
+               request->coa = NULL;
        }
 #endif