/* Allocate new answer and add it to answer list (destination)  */
static bool _mdns_alloc_answer(mdns_out_answer_t **destnation, uint16_t type, mdns_service_t *service, bool flush, bool bye)
/* Allocate new answer and add it to answer list (destination)  */
static bool _mdns_alloc_answer(mdns_out_answer_t **destnation, uint16_t type, mdns_service_t *service, bool flush, bool bye)
{
    mdns_out_answer_t * d = *destnation;
    while (d) {
        if (d->type == type && d->service == service) {
            return true;
        }
        d = d->next;
    }
    mdns_out_answer_t * a = (mdns_out_answer_t *)malloc(sizeof(mdns_out_answer_t));
    if (!a) {
        HOOK_MALLOC_FAILED;
        return false;
    }
    a->type = type;
    a->service = service;
    a->bye = bye;
    a->flush = flush;
    a->next = NULL;
    queueToEnd(mdns_out_answer_t, *destnation, a);
    return true;
}