void remnode(struct kpnode **node) { if ((*node)->lnext != NULL) remnode(&(*node)->lnext); if ((*node)->rnext != NULL) remnode(&(*node)->rnext); free(*node); *node = NULL; return; }
static int zts_delete(Tcp_session sess) { LinkNode node; node = linknodebydatum(ztcp_sessions, (void *)sess); if (!node) { return 1; } ztcp_free_session(getdata(node)); remnode(ztcp_sessions, node); return 0; }