Author: rpaulo
Date: Tue Jun 1 14:20:58 2010
New Revision: 208699
URL: http://svn.freebsd.org/changeset/base/208699
Log:
Fix resource leaks in ieee80211_ioctl_setchanlist() in case of error.
Found with: Coverity Prevent(tm)
CID: 4115
MFC after: 3 days
Modified:
head/sys/net80211/ieee80211_ioctl.c
Modified: head/sys/net80211/ieee80211_ioctl.c
==============================================================================
--- head/sys/net80211/ieee80211_ioctl.c Tue Jun 1 14:18:44 2010
(r208698)
+++ head/sys/net80211/ieee80211_ioctl.c Tue Jun 1 14:20:58 2010
(r208699)
@@ -1628,8 +1628,10 @@ ieee80211_ioctl_setchanlist(struct ieee8
if (list == NULL)
return ENOMEM;
error = copyin(ireq->i_data, list, ireq->i_len);
- if (error)
+ if (error) {
+ free(list, M_TEMP);
return error;
+ }
nchan = 0;
chanlist = list + ireq->i_len; /* NB: zero'd already */
maxchan = ireq->i_len * NBBY;
@@ -1645,8 +1647,10 @@ ieee80211_ioctl_setchanlist(struct ieee8
nchan++;
}
}
- if (nchan == 0)
+ if (nchan == 0) {
+ free(list, M_TEMP);
return EINVAL;
+ }
if (ic->ic_bsschan != IEEE80211_CHAN_ANYC && /* XXX */
isclr(chanlist, ic->ic_bsschan->ic_ieee))
ic->ic_bsschan = IEEE80211_CHAN_ANYC;
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"