for(p = (*cp)->aliases; p; p = q) { q = p->next; safe_free((void **) &p->charset); safe_free((void **) &p); }
static void charmap_free(CHARMAP **cp){  if(!cp || !*cp)    return ;    safe_free((void **) &(*cp)->charset);  safe_free((void **) cp);    return;}