server: close the TCP socket while stopping a service

The function free_service() does not close the TCL socket when the
service is shutdown.

Add the necessarily code.

Change-Id: I58c5c4fee3111949fcc143c6226522c29d976493
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9376
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
Antonio Borneo
2026-01-04 17:34:39 +01:00
parent 00e4fb653d
commit 5e7182368e

View File

@@ -193,6 +193,8 @@ static void free_service(struct service *c)
{
if (c->type == CONNECTION_PIPE && c->fd != -1)
close(c->fd);
if (c->type == CONNECTION_TCP && c->fd != -1)
close_socket(c->fd);
if (c->service_dtor)
c->service_dtor(c);
free(c->name);