/* Remove and free answer from answer list (destination)  */
static void _mdns_dealloc_answer(mdns_out_answer_t **destnation, uint16_t type, mdns_srv_item_t *service)
/* Remove and free answer from answer list (destination)  */
static void _mdns_dealloc_answer(mdns_out_answer_t **destnation, uint16_t type, mdns_srv_item_t *service)
{
    mdns_out_answer_t * d = *destnation;
    if (!d) {
        return;
    }
    mdns_srv_item_t s = {NULL, NULL};
    if (!service) {
        service = &s;
    }
    if (d->type == type && d->service == service->service) {
        *destnation = d->next;
        free(d);
        return;
    }
    while (d->next) {
        mdns_out_answer_t * a = d->next;
        if (a->type == type && a->service == service->service) {
            d->next = a->next;
            free(a);
            return;
        }
        d = d->next;
    }
}