]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
push free coa until after child has returned
authorAlan T. DeKok <aland@freeradius.org>
Thu, 17 Jan 2019 21:48:50 +0000 (16:48 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 17 Jan 2019 21:48:50 +0000 (16:48 -0500)
src/main/process.c

index 5b4cc5afdcc7de529839204332d6a09fb1c6d266..d589b4e070aa2f133ec0d9b38411c25875b6d70f 100644 (file)
@@ -668,9 +668,12 @@ static void request_done(REQUEST *request, int action)
         */
        if (action == FR_ACTION_CANCELLED) {
                action = FR_ACTION_DONE;
-#ifdef WITH_COA
-               if (request->coa) TALLOC_FREE(request->coa);
 
+#ifdef WITH_COA
+               /*
+                *      Don't touch request->coa, it's in the middle
+                *      of being processed...
+                */
        } else {
                /*
                 *      Move the CoA request to its own handler, but
@@ -822,6 +825,15 @@ static void request_done(REQUEST *request, int action)
        rad_assert(request->child_pid == NO_SUCH_CHILD_PID);
 #endif
 
+#ifdef WITH_COA
+       /*
+        *      Now that the child is done, free the CoA packet.  If
+        *      the CoA is running, it's already been separated.
+        */
+       if (request->coa) TALLOC_FREE(request->coa);
+#endif
+
+
        /*
         *      @todo: do final states for TCP sockets, too?
         */