Fix segmentation fault by not freeing shared SSL in remove_tunnel

- Prevent SSL double-free when individual tunnels are closed
- SSL contexts are managed only at connection level
- Fixes crashes when server closes tunnels
parent 8c26f858
...@@ -133,9 +133,8 @@ void remove_tunnel(const char *request_id) { ...@@ -133,9 +133,8 @@ void remove_tunnel(const char *request_id) {
if (active_tunnels[i]->sock >= 0) { if (active_tunnels[i]->sock >= 0) {
close(active_tunnels[i]->sock); close(active_tunnels[i]->sock);
} }
if (active_tunnels[i]->ssl) { // Don't free SSL here - it's managed at the connection level
SSL_free(active_tunnels[i]->ssl); active_tunnels[i]->ssl = NULL;
}
if (active_tunnels[i]->outgoing_buffer) { if (active_tunnels[i]->outgoing_buffer) {
frame_buffer_free(active_tunnels[i]->outgoing_buffer); frame_buffer_free(active_tunnels[i]->outgoing_buffer);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment