vnc: fix coverity warning
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 11 Feb 2015 16:33:33 +0000 (17:33 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Mon, 16 Feb 2015 07:48:00 +0000 (08:48 +0100)
vnc_display_local_addr will not be called with an invalid display id.
Add assert() to silence coverity warning about a null pointer dereference.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
ui/vnc.c

index 14289fd..10a2724 100644 (file)
--- a/ui/vnc.c
+++ b/ui/vnc.c
@@ -3248,6 +3248,7 @@ char *vnc_display_local_addr(const char *id)
 {
     VncDisplay *vs = vnc_display_find(id);
 
+    assert(vs);
     return vnc_socket_local_addr("%s:%s", vs->lsock);
 }