mirror of https://github.com/xemu-project/xemu.git
vnc: Drop superfluous conditionals around g_free()
Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
d279279e2b
commit
64641d8764
|
@ -443,10 +443,8 @@ static int vnc_set_x509_credential(VncDisplay *vd,
|
||||||
{
|
{
|
||||||
struct stat sb;
|
struct stat sb;
|
||||||
|
|
||||||
if (*cred) {
|
g_free(*cred);
|
||||||
g_free(*cred);
|
*cred = NULL;
|
||||||
*cred = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
*cred = g_malloc(strlen(certdir) + strlen(filename) + 2);
|
*cred = g_malloc(strlen(certdir) + strlen(filename) + 2);
|
||||||
|
|
||||||
|
|
12
ui/vnc.c
12
ui/vnc.c
|
@ -2972,10 +2972,8 @@ static void vnc_display_close(DisplayState *ds)
|
||||||
|
|
||||||
if (!vs)
|
if (!vs)
|
||||||
return;
|
return;
|
||||||
if (vs->display) {
|
g_free(vs->display);
|
||||||
g_free(vs->display);
|
vs->display = NULL;
|
||||||
vs->display = NULL;
|
|
||||||
}
|
|
||||||
if (vs->lsock != -1) {
|
if (vs->lsock != -1) {
|
||||||
qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL);
|
qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL);
|
||||||
close(vs->lsock);
|
close(vs->lsock);
|
||||||
|
@ -3010,10 +3008,8 @@ int vnc_display_password(DisplayState *ds, const char *password)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (vs->password) {
|
g_free(vs->password);
|
||||||
g_free(vs->password);
|
vs->password = NULL;
|
||||||
vs->password = NULL;
|
|
||||||
}
|
|
||||||
if (password) {
|
if (password) {
|
||||||
vs->password = g_strdup(password);
|
vs->password = g_strdup(password);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue