Move pointer reference to after null pointer check.

Ticket: http://madwifi.org/ticket/1650
Original Patch: Signed-off-by: Josef Kriegl <Josef.Kriegl@gmail.com>


git-svn-id: http://madwifi-project.org/svn/madwifi/trunk@2856 0192ed92-7a03-0410-a25b-9323aeb14dbd
This commit is contained in:
mentor 2007-11-16 11:24:22 +00:00
parent aebfe2bea0
commit bd6e91ee85
1 changed files with 2 additions and 3 deletions

View File

@ -2063,16 +2063,15 @@ ieee80211_parse_rsn(struct ieee80211vap *vap, u_int8_t *frm,
void
ieee80211_saveie(u_int8_t **iep, const u_int8_t *ie)
{
u_int ielen = ie[1] + 2;
if ((*iep == NULL) || (ie == NULL) || ((*iep)[1] != ie[1])) {
if (*iep != NULL)
FREE(*iep, M_DEVBUF);
*iep = NULL;
if (ie != NULL)
MALLOC(*iep, void*, ielen, M_DEVBUF, M_NOWAIT);
MALLOC(*iep, void*, ie[1] + 2, M_DEVBUF, M_NOWAIT);
}
if ((*iep != NULL) && (ie != NULL))
memcpy(*iep, ie, ielen);
memcpy(*iep, ie, ie[1] + 2);
}
EXPORT_SYMBOL(ieee80211_saveie);