mirror of https://gitee.com/openkylin/qemu.git
vnc: Plug minor memory leak in vnc_display_open()
vnc_display_print_local_addr() leaks the Error object when qio_channel_socket_get_local_address() fails. Seems unlikely. Called when we create a VNC display with vnc_display_open(). Plug the leak by passing NULL to ignore the error. Cc: Daniel P. Berrange <berrange@redhat.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200630090351.1247703-12-armbru@redhat.com> Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
This commit is contained in:
parent
05584d12ae
commit
b94b3c02df
3
ui/vnc.c
3
ui/vnc.c
|
@ -3274,13 +3274,12 @@ int vnc_display_pw_expire(const char *id, time_t expires)
|
|||
static void vnc_display_print_local_addr(VncDisplay *vd)
|
||||
{
|
||||
SocketAddress *addr;
|
||||
Error *err = NULL;
|
||||
|
||||
if (!vd->listener || !vd->listener->nsioc) {
|
||||
return;
|
||||
}
|
||||
|
||||
addr = qio_channel_socket_get_local_address(vd->listener->sioc[0], &err);
|
||||
addr = qio_channel_socket_get_local_address(vd->listener->sioc[0], NULL);
|
||||
if (!addr) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue