Skip to content

Commit

Permalink
AP_Scripting: prevent double close in web server
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge committed Feb 13, 2024
1 parent 7b36adf commit 5d789f4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion libraries/AP_Scripting/applets/net_webserver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -913,7 +913,10 @@ local function Client(_sock, _idx)

function self.remove()
DEBUG(string.format("%u: removing client OFFSET=%u", idx, offset))
sock:close()
if sock then
sock:close()
sock = nil
end
self.closed = true
end

Expand Down

0 comments on commit 5d789f4

Please sign in to comment.