From 64641d876466333b833e8a188a46e2e06c008bac Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Fri, 6 Jun 2014 18:47:43 +0200 Subject: vnc: Drop superfluous conditionals around g_free() Signed-off-by: Markus Armbruster Signed-off-by: Gerd Hoffmann --- ui/vnc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'ui/vnc.c') diff --git a/ui/vnc.c b/ui/vnc.c index 1684206184..d771a2cd4f 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -2972,10 +2972,8 @@ static void vnc_display_close(DisplayState *ds) if (!vs) return; - if (vs->display) { - g_free(vs->display); - vs->display = NULL; - } + g_free(vs->display); + vs->display = NULL; if (vs->lsock != -1) { qemu_set_fd_handler2(vs->lsock, NULL, NULL, NULL, NULL); close(vs->lsock); @@ -3010,10 +3008,8 @@ int vnc_display_password(DisplayState *ds, const char *password) return -EINVAL; } - if (vs->password) { - g_free(vs->password); - vs->password = NULL; - } + g_free(vs->password); + vs->password = NULL; if (password) { vs->password = g_strdup(password); } -- cgit v1.2.3