From 6c076cfe5a656b03d4bd0dd9742e7a02dce2b957 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Thu, 16 Feb 2017 10:28:32 +0100 Subject: os: Fix a memory leak Backported from X.org (+ coding style fixes in other free() calls): commit 617b7d22115ccaaaa7ec69c99885054d33a3bc37 Author: Pauli Nieminen Date: Thu Dec 30 19:19:42 2010 +0200 os: Fix a memory leak Signed-off-by: Pauli Nieminen Reviewed-by: Alan Coopersmith Reviewed-by: Daniel Stone Backported-to-NX-by: Mike Gabriel --- nx-X11/programs/Xserver/os/access.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'nx-X11/programs/Xserver/os') diff --git a/nx-X11/programs/Xserver/os/access.c b/nx-X11/programs/Xserver/os/access.c index 152287889..d745bde3a 100644 --- a/nx-X11/programs/Xserver/os/access.c +++ b/nx-X11/programs/Xserver/os/access.c @@ -1240,20 +1240,22 @@ Bool LocalClient(ClientPtr client) &alen, (void **)&addr); if (family == -1) { - free ((char *) from); + free(from); return FALSE; } if (family == FamilyLocal) { - free ((char *) from); + free(from); return TRUE; } for (host = selfhosts; host; host = host->next) { - if (addrEqual (family, addr, alen, host)) + if (addrEqual (family, addr, alen, host)) { + free(from); return TRUE; + } } - free ((char *) from); + free(from); } return FALSE; } -- cgit v1.2.3