gdbstub: Fix fd leak in gdbserver_open() error path
PATCH 1/1 gdbstub: Fix fd leak in gdbserver_open() error path
Fix a leak of a file descriptor in error exit paths in gdbserver_open().
Signed-off-by Peter Maydell <[email protected]>
---
Of no great consequence, but it was in the pile of coverity complaints and it's a trivial fix.
gdbstub.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
gdbstub.c +2 -0
@@ -2762,11 +2762,13 @@ static int gdbserver_open(int port) ret =bind (fd, (struct sockaddr *)&sockaddr,sizeof (sockaddr));if (ret <0 ) {perror ("bind" ); +close (fd);return -1 ; } ret =listen (fd,0 );if (ret <0 ) {perror ("listen" ); +close (fd);return -1 ; }return fd;
Signature · 1 line
1.7.5.4
Stefan Hajnoczi
AppliedQuoted 10 lines · Peter Maydell
Fix a leak of a file descriptor in error exit paths in
gdbserver_open().Signed-off-by Peter Maydell <[email protected]>---
Of no great consequence, but it was in the pile of coverity complaints and it's a trivial fix.gdbstub.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
Thanks, applied to the trivial patches -next tree:
https://github.com/stefanha/qemu/commits/trivial-patches-next
Stefan