]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove duplicate code
authorAlan T. DeKok <aland@freeradius.org>
Mon, 19 Jun 2017 17:16:06 +0000 (13:16 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Mon, 19 Jun 2017 18:16:30 +0000 (14:16 -0400)
src/lib/io/worker.c

index 2316ac2b65de83b821ba296e9a5d8daca16c4f3d..3afbef9d181306e993f06292cba242d9dfba5c4c 100644 (file)
@@ -1051,12 +1051,6 @@ nomem:
                return NULL;
        }
 
-       if (fr_event_user_insert(worker->el, fr_worker_evfilt_user, worker) < 0) {
-               fr_strerror_printf("Failed updating event list: %s", fr_strerror());
-               talloc_free(worker);
-               return NULL;
-       }
-
        /*
         *      The worker thread starts now.  Manually initialize it,
         *      because we're tracking request time, not the time that
@@ -1086,12 +1080,6 @@ nomem:
                return NULL;
        }
 
-       if (fr_event_user_insert(worker->el, fr_worker_evfilt_user, worker) < 0) {
-               fr_strerror_printf("Failed updating event list: %s", fr_strerror());
-               talloc_free(worker);
-               return NULL;
-       }
-
        WORKER_HEAP_INIT(to_decode, worker_message_cmp, fr_channel_data_t, channel.heap_id);
        WORKER_HEAP_INIT(localized, worker_message_cmp, fr_channel_data_t, channel.heap_id);
 
@@ -1103,6 +1091,12 @@ nomem:
        FR_DLIST_INIT(worker->time_order);
        FR_DLIST_INIT(worker->waiting_to_die);
 
+       if (fr_event_user_insert(worker->el, fr_worker_evfilt_user, worker) < 0) {
+               fr_strerror_printf("Failed updating event list: %s", fr_strerror());
+               talloc_free(worker);
+               return NULL;
+       }
+
        if (fr_event_post_insert(worker->el, fr_worker_post_event, worker) < 0) {
                fr_strerror_printf("Failed inserting post-processing event");
                talloc_free(worker);