Skip to content

Commit 269c893

Browse files
committed
assert session_ptr[0] ~= nil
1 parent f332a39 commit 269c893

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/resty/core/socket.lua

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@ local registry = debug.getregistry()
1515
local C = ffi.C
1616
local ffi_new = ffi.new
1717
local ffi_str = ffi.string
18-
local ffi_gc = ffi.gc
18+
local ffi_gc = ffi.gc
1919

2020
local get_string_buf = base.get_string_buf
21-
local get_size_ptr = base.get_size_ptr
22-
local get_request = base.get_request
21+
local get_size_ptr = base.get_size_ptr
22+
local get_request = base.get_request
2323

2424
local co_yield = coroutine._yield
2525

@@ -251,6 +251,8 @@ local function sslhandshake(cosocket, reused_session, server_name, ssl_verify,
251251
return nil
252252
end
253253

254+
assert(session_ptr[0] ~= nil)
255+
254256
return ffi_gc(session_ptr[0], C.ngx_http_lua_ffi_ssl_free_session)
255257
end
256258

0 commit comments

Comments
 (0)