[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] vnc: Drop superfluous conditionals around g
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] vnc: Drop superfluous conditionals around g_free() |
Date: |
Fri, 06 Jun 2014 10:45:17 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
On 06/06/2014 10:36 AM, Markus Armbruster wrote:
> Signed-off-by: Markus Armbruster <address@hidden>
> ---
> 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);
Makes a dead store to *cred more obvious.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature