#include "timeq.h"
#include "IOHandler.h"
+#include "tools.h"
+#include "log.h"
static struct timeq_entry *timeq_events;
#ifdef HAVE_THREADS
struct timeq_entry *entry = event->iofd->data;
switch(event->type) {
case IOEVENT_TIMEOUT:
+ if(entry->name) {
+ free(entry->name);
+ entry->name = NULL;
+ }
entry->callback(entry->data);
entry->iofd = NULL;
timeq_del(entry);
struct timeq_entry *entry = malloc(sizeof(*entry));
if (!entry)
{
- perror("malloc() failed");
+ printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
return NULL;
}
#ifdef HAVE_THREADS