]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
touch before free, not after
authorAlan T. DeKok <aland@freeradius.org>
Thu, 16 Nov 2017 16:38:17 +0000 (11:38 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Thu, 16 Nov 2017 16:38:17 +0000 (11:38 -0500)
src/modules/proto_detail/proto_detail_work.c

index 2e6b86fb198c4ba4b74eb00089e3ee04d496de88..2c5fda69aa25e9f9c811ded48b2aaf5371a3397b 100644 (file)
@@ -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;
 }