/* The ifconfig command cleanup process, free the allocated memory. */
VOID IfConfigCleanup(IN IFCONFIG_PRIVATE_DATA *Private)
/* The ifconfig command cleanup process, free the allocated memory. */
VOID IfConfigCleanup(IN IFCONFIG_PRIVATE_DATA *Private)
{
  LIST_ENTRY             *Entry;
  LIST_ENTRY             *NextEntry;
  IFCONFIG_INTERFACE_CB  *IfCb;
  ASSERT (Private != NULL);
  if (Private->VarArg != NULL) {
    FreeArgList (Private->VarArg);
  }
  if (Private->IfName != NULL) {
    FreePool (Private->IfName);
  }
  NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, &Private->IfList) {
    IfCb = NET_LIST_USER_STRUCT (Entry, IFCONFIG_INTERFACE_CB, Link);
    RemoveEntryList (&IfCb->Link);
    if (IfCb->IfInfo != NULL) {
      FreePool (IfCb->IfInfo);
    }
    FreePool (IfCb);
  }
  FreePool (Private);
}