]> 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 18:43:50 +0000 (19:43 +0100)
src/main/process.c

index d143aae0a626978ba8b24366b7e9763954b5b192..c18894cc09838b4cd382614b9f47158736160c6f 100644 (file)
@@ -3387,7 +3387,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
 
        /*
@@ -3619,6 +3623,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