Date: Tue, 1 Jun 2010 14:20:59 +0000 (UTC) From: Rui Paulo <rpaulo@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r208699 - head/sys/net80211 Message-ID: <201006011420.o51EKxh9055219@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201006011420.o51EKxh9055219>