[PATCH libXau 3/3] AuRead.c: remove redundant null check on calling free()

walter harms wharms at bfs.de
Sat Oct 28 17:14:22 UTC 2017


this removes simply unneeded code from XauReadAuth

Signed-off-by: Walter Harms <wharms at bfs.de>
---
 AuRead.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/AuRead.c b/AuRead.c
index 5d41f03..d48906b 100644
--- a/AuRead.c
+++ b/AuRead.c
@@ -77,25 +77,25 @@ XauReadAuth (FILE *auth_file)
     if (read_counted_string (&local.address_length, &local.address, auth_file) == 0)
 	return NULL;
     if (read_counted_string (&local.number_length, &local.number, auth_file) == 0) {
-	if (local.address) free (local.address);
+	free (local.address);
 	return NULL;
     }
     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 NULL;
     }
     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 NULL;
     }
     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);
-- 
2.1.4



More information about the xorg-devel mailing list