In the server handler (src/server/server.c:77-113), the multithreading path frees the Config via pipeline_context_receiver_destroy(), but the non-multithreading path calls receive_files(config, file_descriptor) and then falls through to close(file_descriptor) without ever freeing config. Every non-multithreaded TCP or SSH connection leaks the entire received configuration.
This is also reachable in --stdio mode, which is the SSH transport path and therefore leaks once per SSH invocation.
Location
src/server/server.c:111 — receive_files(config, file_descriptor); is called without a matching config_delete(config).
src/server/server.c:109 — multithreading path correctly destroys the context.
Suggested fix
Add config_delete(config); after the non-multithreaded receive_files() call.
Refactor the handler so that cleanup is centralized and cannot be missed.
Severity
High
Category
bug
This issue was automatically generated by the issue-creator agent.
## Description
In the server handler (`src/server/server.c:77-113`), the multithreading path frees the `Config` via `pipeline_context_receiver_destroy()`, but the non-multithreading path calls `receive_files(config, file_descriptor)` and then falls through to `close(file_descriptor)` without ever freeing `config`. Every non-multithreaded TCP or SSH connection leaks the entire received configuration.
This is also reachable in `--stdio` mode, which is the SSH transport path and therefore leaks once per SSH invocation.
## Location
- `src/server/server.c:111` — `receive_files(config, file_descriptor);` is called without a matching `config_delete(config)`.
- `src/server/server.c:109` — multithreading path correctly destroys the context.
## Suggested fix
1. Add `config_delete(config);` after the non-multithreaded `receive_files()` call.
2. Refactor the handler so that cleanup is centralized and cannot be missed.
## Severity
High
## Category
bug
---
_This issue was automatically generated by the issue-creator agent._
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description
In the server handler (
src/server/server.c:77-113), the multithreading path frees theConfigviapipeline_context_receiver_destroy(), but the non-multithreading path callsreceive_files(config, file_descriptor)and then falls through toclose(file_descriptor)without ever freeingconfig. Every non-multithreaded TCP or SSH connection leaks the entire received configuration.This is also reachable in
--stdiomode, which is the SSH transport path and therefore leaks once per SSH invocation.Location
src/server/server.c:111—receive_files(config, file_descriptor);is called without a matchingconfig_delete(config).src/server/server.c:109— multithreading path correctly destroys the context.Suggested fix
config_delete(config);after the non-multithreadedreceive_files()call.Severity
High
Category
bug
This issue was automatically generated by the issue-creator agent.