* Daniel P. Berrange (berra...@redhat.com) wrote: > If socket_listen_cleanup is passed an invalid FD, then querying the socket > local address will fail. We must thus be prepared for the returned addr to > be NULL > > Reported-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > Signed-off-by: Daniel P. Berrange <berra...@redhat.com>
Reviewed-by: Dr. David Alan Gilbert <dgilb...@redhat.com> > --- > util/qemu-sockets.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/util/qemu-sockets.c b/util/qemu-sockets.c > index b47fb45885..c7fdaa63fb 100644 > --- a/util/qemu-sockets.c > +++ b/util/qemu-sockets.c > @@ -1073,6 +1073,9 @@ void socket_listen_cleanup(int fd, Error **errp) > SocketAddress *addr; > > addr = socket_local_address(fd, errp); > + if (!addr) { > + return; > + } > > if (addr->type == SOCKET_ADDRESS_TYPE_UNIX > && addr->u.q_unix.path) { > -- > 2.13.6 > -- Dr. David Alan Gilbert / dgilb...@redhat.com / Manchester, UK