static int pthread_timer_open(void)
{
struct pthread_timer *timer;
+ int fd;
if (!(timer = ao2_alloc(sizeof(*timer), pthread_timer_destructor))) {
errno = ENOMEM;
ao2_link(pthread_timers, timer);
ao2_unlock(pthread_timers);
- return timer->pipe[PIPE_READ];
+ fd = timer->pipe[PIPE_READ];
+
+ ao2_ref(timer, -1);
+
+ return fd;
}
static void pthread_timer_close(int handle)
static void read_pipe(int rd_fd, unsigned int quantity, int clear)
{
-
ast_assert(quantity || clear);
if (!quantity && clear) {