Skip to content

Commit

Permalink
free packet before erroring to avoid resource leak if the app is rest…
Browse files Browse the repository at this point in the history
…arted
  • Loading branch information
petebristow committed Nov 13, 2015
1 parent ce8eaee commit df6cb66
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/apps/tap/tap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function Tap:pull ()
return
end
if not len then
packet.free(p)
error("Failed read on " .. self.name .. ": " .. tostring(err))
end
p.length = len
Expand Down

0 comments on commit df6cb66

Please sign in to comment.