Skip to content

Commit

Permalink
fix outputpacket memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
zxystd committed Sep 6, 2020
1 parent 81df136 commit 7d27457
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion itlwm/itlwm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ UInt32 itlwm::outputPacket(mbuf_t m, void *param)
if (!(mbuf_flags(m) & MBUF_PKTHDR) ){
XYLog("%s pkthdr is NULL!!\n", __FUNCTION__);
ifp->netStat->outputErrors++;
freePacket(m);
return kIOReturnOutputDropped;
}
if (mbuf_type(m) == MBUF_TYPE_FREE) {
Expand All @@ -565,8 +566,10 @@ UInt32 itlwm::outputPacket(mbuf_t m, void *param)
if (ifp->if_snd->lockEnqueue(m)) {
(*ifp->if_start)(ifp);
return kIOReturnOutputSuccess;
} else {
freePacket(m);
return kIOReturnOutputDropped;
}
return kIOReturnOutputDropped;
}

UInt32 itlwm::getFeatures() const
Expand Down

0 comments on commit 7d27457

Please sign in to comment.