Merge pull request #2032 from signalwire/coverity_06042023_mod_xml_rpc

[mod_xml_rpc] Coverity CID 1294469 (Resource leak)
This commit is contained in:
Andrey Volk 2023-04-07 09:30:07 +03:00 committed by GitHub
commit be3a73af62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -614,7 +614,7 @@ abyss_bool websocket_hook(TSession *r)
if (ret != 0) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "handshake error %d\n", ret);
return FALSE;
goto err;
}
if (switch_event_bind_removable("websocket", SWITCH_EVENT_CUSTOM, "websocket::stophook", stop_hook_event_handler, wsh, &nodes[node_count++]) != SWITCH_STATUS_SUCCESS) {
@ -696,8 +696,11 @@ abyss_bool websocket_hook(TSession *r)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "wsh->down = %d, node_count = %d\n", wsh->down, node_count);
switch_yield(2000);
while (--node_count >= 0) switch_event_unbind(&nodes[node_count]);
err:
ws_destroy(wsh);
switch_safe_free(wsh);
return FALSE;