]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
notes on listener being thread-safe here
authorAlan T. DeKok <aland@freeradius.org>
Tue, 30 Oct 2018 15:14:38 +0000 (11:14 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Tue, 30 Oct 2018 15:46:22 +0000 (11:46 -0400)
src/modules/proto_detail/proto_detail.c
src/modules/proto_detail/proto_detail_file.c

index 806411ed4de9b338138ecbbbf4ea744787487180..6900598d7f0eaf107b622d3c8e1a6454fd036534 100644 (file)
@@ -436,9 +436,10 @@ static int mod_open(void *instance, fr_schedule_t *sc, CONF_SECTION *conf)
         *      back again.
         */
        li = talloc_zero(inst, fr_listen_t);
+       talloc_set_destructor(li, fr_io_listen_free);
 
        li->app_io = inst->app_io;
-       li->thread_instance = talloc_zero_array(li, uint8_t, li->app_io->thread_inst_size);
+       li->thread_instance = talloc_zero_array(NULL, uint8_t, li->app_io->thread_inst_size);
        talloc_set_name(li->thread_instance, "proto_%s_thread_t", inst->app_io->name);
        li->app_io_instance = inst->app_io_instance;
 
index 563f4fbb19bd3c7c51949c32be4bb87c8495ec82..4ca2ff96fa55836dc780aa70cd97aa4083f106d6 100644 (file)
@@ -297,6 +297,10 @@ static int work_exists(proto_detail_file_thread_t *thread, int fd)
                return 1;
        }
 
+       /*
+        *      This listener is allocated in a thread-specific
+        *      context, so it doesn't need a destructor,
+        */
        MEM(li = talloc_zero(NULL, fr_listen_t));
 
        /*