/* Free all network profiles in a profile list. */
VOID WifiMgrFreeProfileList(IN LIST_ENTRY *ProfileList)
/* Free all network profiles in a profile list. */
VOID WifiMgrFreeProfileList(IN LIST_ENTRY *ProfileList)
{
  WIFI_MGR_NETWORK_PROFILE  *Profile;
  LIST_ENTRY                *Entry;
  LIST_ENTRY                *NextEntry;
  if (ProfileList == NULL) {
    return;
  }
  NET_LIST_FOR_EACH_SAFE (Entry, NextEntry, ProfileList) {
    Profile = NET_LIST_USER_STRUCT_S (
                Entry,
                WIFI_MGR_NETWORK_PROFILE,
                Link,
                WIFI_MGR_PROFILE_SIGNATURE
                );
    WifiMgrCleanProfileSecrets (Profile);
    if (Profile->Network.AKMSuite != NULL) {
      FreePool (Profile->Network.AKMSuite);
    }
    if (Profile->Network.CipherSuite != NULL) {
      FreePool (Profile->Network.CipherSuite);
    }
    FreePool (Profile);
  }
}