From 5929dfdebf9c9914187f1b41f70d0b721def7122 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Fri, 4 Oct 2019 21:05:49 +0200 Subject: AuRead.c: remove redundant null check on calling free() Backport of this commit: commit 7ba7085b4f01f3cd72008712a5333ea3f0edfd88 Author: walter harms Date: Sat Oct 28 19:14:22 2017 +0200 AuRead.c: remove redundant null check on calling free() this removes simply unneeded code from XauReadAuth Signed-off-by: Walter Harms Reviewed-by: Daniel Martin Reviewed-by: Emil Velikov --- nx-X11/lib/src/AuRead.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'nx-X11/lib') diff --git a/nx-X11/lib/src/AuRead.c b/nx-X11/lib/src/AuRead.c index d63dc96e9..993aa24b9 100644 --- a/nx-X11/lib/src/AuRead.c +++ b/nx-X11/lib/src/AuRead.c @@ -120,25 +120,25 @@ FILE *auth_file; if (read_counted_string (&local.address_length, &local.address, auth_file) == 0) return 0; if (read_counted_string (&local.number_length, &local.number, auth_file) == 0) { - if (local.address) free (local.address); + free (local.address); return 0; } if (read_counted_string (&local.name_length, &local.name, auth_file) == 0) { - if (local.address) free (local.address); - if (local.number) free (local.number); + free (local.address); + free (local.number); return 0; } if (read_counted_string (&local.data_length, &local.data, auth_file) == 0) { - if (local.address) free (local.address); - if (local.number) free (local.number); - if (local.name) free (local.name); + free (local.address); + free (local.number); + free (local.name); return 0; } ret = (Xauth *) malloc (sizeof (Xauth)); if (!ret) { - if (local.address) free (local.address); - if (local.number) free (local.number); - if (local.name) free (local.name); + free (local.address); + free (local.number); + free (local.name); if (local.data) { bzero (local.data, local.data_length); free (local.data); -- cgit v1.2.3