wtap should check if ieee80211_vap_setup fails.

* If ieee80211_vap_setup fails, we free allocated M_80211_VAP
  memory and return NULL;

Approved by: adrian (mentor)
This commit is contained in:
Monthadar Al Jaberi 2012-12-18 08:44:59 +00:00
parent 3c6b71699a
commit 263bbda93d

View File

@ -334,6 +334,10 @@ wtap_vap_create(struct ieee80211com *ic, const char name[IFNAMSIZ],
vap = (struct ieee80211vap *) avp;
error = ieee80211_vap_setup(ic, vap, name, unit, IEEE80211_M_MBSS,
flags | IEEE80211_CLONE_NOBEACONS, bssid, mac);
if (error) {
free((struct wtap_vap*) vap, M_80211_VAP);
return NULL;
}
/* override various methods */
avp->av_recv_mgmt = vap->iv_recv_mgmt;