I must admit I don't really understand why we had a rare case
of use-after-free in the sendmmsg call, but this change should avoid
that without affecting anything else.
}
for (int i = 0; i < q->len; ++i) {
qr_task_on_send(q->items[i].task, NULL, i < sent_len ? 0 : err);
+ worker_task_unref(q->items[i].task);
}
q->len = 0;
}
kr_log_error("ERROR: called udp_queue_push(fd = %d, ...)\n", fd);
abort();
}
+ worker_task_ref(task);
/* Get a valid correct queue. */
if (fd >= state.udp_queues_len) {
const int new_len = fd + 1;