From: Alan T. DeKok Date: Thu, 17 Jan 2019 21:48:50 +0000 (-0500) Subject: push free coa until after child has returned X-Git-Tag: release_3_0_18~61 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd11fa0dcaa09ffb7e9050b8a4d7d419e08bd9a5;p=thirdparty%2Ffreeradius-server.git push free coa until after child has returned --- diff --git a/src/main/process.c b/src/main/process.c index 5b4cc5afdcc..d589b4e070a 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -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? */