[BUGFIX] wifi: mac80211: mlme: fix memory leak

When re-parsing the elements here (with changed mode), free
the original ones first to avoid leaking memory.

type=bugfix
ticket=none
fixes=I3e61f4cfe9da89008e1854160093c76a1e69dc2a

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Change-Id: Icb5b84cba3ea420794cf009cf18ec3d76e434736
Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/104112
automatic-review: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
tested: iil_jenkins iil_jenkins <EC.GER.UNIX.IIL.JENKINS@INTEL.COM>
Reviewed-by: Miriam Rachel Korenblit <miriam.rachel.korenblit@intel.com>
Reviewed-on: https://gerritwcs.ir.intel.com/c/iwlwifi-stack-dev/+/104591
x-iwlwifi-stack-dev: e801469d3852c28b87d45ab16dd05d0a806d4fb9
2 files changed