From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsxJ3-0003zq-O8 for qemu-devel@nongnu.org; Fri, 06 Jun 2014 12:48:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WsxIx-0008MD-JY for qemu-devel@nongnu.org; Fri, 06 Jun 2014 12:47:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:7173) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WsxIx-0008M2-BJ for qemu-devel@nongnu.org; Fri, 06 Jun 2014 12:47:47 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s56GlkuJ018504 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 6 Jun 2014 12:47:46 -0400 From: Markus Armbruster Date: Fri, 6 Jun 2014 18:47:43 +0200 Message-Id: <1402073264-9606-2-git-send-email-armbru@redhat.com> In-Reply-To: <1402073264-9606-1-git-send-email-armbru@redhat.com> References: <1402073264-9606-1-git-send-email-armbru@redhat.com> Subject: [Qemu-devel] [PATCH v2 1/2] vnc: Drop superfluous conditionals around g_free() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kraxel@redhat.com Signed-off-by: Markus Armbruster --- ui/vnc-tls.c | 6 ++---- ui/vnc.c | 12 ++++-------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/ui/vnc-tls.c b/ui/vnc-tls.c index 50275de..6392326 100644 --- a/ui/vnc-tls.c +++ b/ui/vnc-tls.c @@ -443,10 +443,8 @@ static int vnc_set_x509_credential(VncDisplay *vd, { struct stat sb; - if (*cred) { - g_free(*cred); - *cred = NULL; - } + g_free(*cred); + *cred = NULL; *cred = g_malloc(strlen(certdir) + strlen(filename) + 2); diff --git a/ui/vnc.c b/ui/vnc.c index 1684206..d771a2c 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); } -- 1.9.3