From: Alan T. DeKok Date: Thu, 16 Nov 2017 16:38:17 +0000 (-0500) Subject: touch before free, not after X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1476566ad48c07fe6e23755fa83eeaa9d59caceb;p=thirdparty%2Ffreeradius-server.git touch before free, not after --- diff --git a/src/modules/proto_detail/proto_detail_work.c b/src/modules/proto_detail/proto_detail_work.c index 2e6b86fb198..2c5fda69aa2 100644 --- a/src/modules/proto_detail/proto_detail_work.c +++ b/src/modules/proto_detail/proto_detail_work.c @@ -687,10 +687,6 @@ static int mod_close(void *instance) close(inst->fd); inst->fd = -1; - if (inst->free_on_close) { - talloc_free(talloc_parent(inst)); - } - /* * Do this as the last thing before exiting. * @@ -698,6 +694,10 @@ static int mod_close(void *instance) */ inst->parent->work_io_instance = NULL; + if (inst->free_on_close) { + talloc_free(talloc_parent(inst)); + } + return 0; }