/* The IfConfig6 cleanup process, free the allocated memory. */
VOID IfConfig6Cleanup(IN IFCONFIG6_PRIVATE_DATA *Private)
/* The IfConfig6 cleanup process, free the allocated memory. */
VOID IfConfig6Cleanup(IN IFCONFIG6_PRIVATE_DATA *Private)
{
  LIST_ENTRY              *Entry;
  LIST_ENTRY              *NextEntry;
  IFCONFIG6_INTERFACE_CB  *IfCb;
  ASSERT (Private != NULL);
  if (Private->VarArg != NULL) {
    IfConfig6FreeArgList (Private->VarArg);
  }
  if (Private->IfName != NULL) {
    FreePool (Private->IfName);
  }
  Entry     = Private->IfList.ForwardLink;
  NextEntry = Entry->ForwardLink;
  while (Entry != &Private->IfList) {
    IfCb = BASE_CR (Entry, IFCONFIG6_INTERFACE_CB, Link);
    RemoveEntryList (&IfCb->Link);
    if (IfCb->IfId != NULL) {
      FreePool (IfCb->IfId);
    }
    if (IfCb->IfInfo != NULL) {
      FreePool (IfCb->IfInfo);
    }
    FreePool (IfCb);
    Entry     = NextEntry;
    NextEntry = Entry->ForwardLink;
  }
  FreePool (Private);
}