Skip to content

Commit

Permalink
LUA try and fix file memory leak
Browse files Browse the repository at this point in the history
  • Loading branch information
magicrub committed Feb 6, 2024
1 parent 63ba710 commit b15ed2e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ROMFS/scripts/maim_web.lua
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,11 @@ local function update() -- this is the loop which periodically runs
end

-- send html file if exists
if file and path:match(".html") then
send_str("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nConnection: close\r\n\r\n")
send_str(file:read("*a"))
if file then
if path:match(".html") then
send_str("HTTP/1.0 200 OK\r\nContent-Type: text/html\r\nConnection: close\r\n\r\n")
send_str(file:read("*a"))
end
file:close()

elseif path == "/zeroize" then
Expand Down

0 comments on commit b15ed2e

Please sign in to comment.