forked from auracaster/openocd
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user