forked from auracaster/openocd
server: fix a new double free()
By reorganizing the free() of the service and its subfields, the
patch reported in 'fixes' exposes a new double free().
Issue detected by 'scan-build'.
Fix it.
Fixes: 5ff384be08 ("semihosting: fix memory leak and double free")
Change-Id: Ief4262e98c9ecdca39d4e2d77e7a0ea87cfa198c
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-on: https://review.openocd.org/c/openocd/+/9266
Tested-by: jenkins
Reviewed-by: Tomas Vanek <vanekt@fbl.cz>
This commit is contained in:
@@ -378,7 +378,6 @@ int remove_service(const char *name, const char *port)
|
||||
if (tmp->type != CONNECTION_STDINOUT)
|
||||
close_socket(tmp->fd);
|
||||
|
||||
free(tmp->priv);
|
||||
free_service(tmp);
|
||||
|
||||
return ERROR_OK;
|
||||
|
||||
Reference in New Issue
Block a user