mirror of
https://github.com/nmap/nmap.git
synced 2026-05-13 08:46:45 +00:00
Avoid dereferencing freed pointer
This commit is contained in:
parent
b6c3989259
commit
d91d876905
1 changed files with 2 additions and 1 deletions
|
|
@ -850,6 +850,7 @@ struct request_context {
|
|||
static int channel_request (lua_State *L, int status, lua_KContext ctx) {
|
||||
int rc;
|
||||
request_context *req_ctx = (request_context *)ctx;
|
||||
const char* request_str = req_ctx->request;
|
||||
|
||||
DO_OR_YIELD((rc = libssh2_channel_process_startup(req_ctx->channel,
|
||||
req_ctx->request, req_ctx->request_len,
|
||||
|
|
@ -859,7 +860,7 @@ static int channel_request (lua_State *L, int status, lua_KContext ctx) {
|
|||
free(req_ctx);
|
||||
|
||||
if (rc != 0)
|
||||
return luaL_error(L, "Error sending %s request", req_ctx->request);
|
||||
return luaL_error(L, "Error sending %s request", request_str);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue