[X2Go-Commits] [nx-libs] 04/29: Keyboard.c: fix memory leak

git-admin at x2go.org git-admin at x2go.org
Sun Jan 7 01:30:58 CET 2018


This is an automated email from the git hooks/post-receive script.

x2go pushed a commit to branch 3.6.x
in repository nx-libs.

commit 0e2c4df8e504e18c4ee73cb91ffaefdf58baecec
Author: Ulrich Sibiller <uli42 at gmx.de>
Date:   Fri Nov 24 00:48:42 2017 +0100

    Keyboard.c: fix memory leak
---
 nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
index 8ae64ee..e77e444 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c
@@ -1904,10 +1904,12 @@ void nxagentKeycodeConversionSetup(void)
       FILE *keyboard_file;
       if (!keyboard_file_path)
       {
-        FatalError("nxagentKeycodeConversionSetup: malloc failed.");
+        free(sessionpath);
+        FatalError("malloc for keyboard file path failed.");
       }
       strcpy(keyboard_file_path, sessionpath);
       strcat(keyboard_file_path, "/keyboard");
+      free(sessionpath);
       if ((keyboard_file = fopen(keyboard_file_path, "w"))) {
         if (drules)
           fprintf(keyboard_file, "rules=\"%s\"\n", drules[0] == '\0' ? "," : drules);

--
Alioth's /home/x2go-admin/maintenancescripts/git/hooks/post-receive-email on /srv/git/code.x2go.org/nx-libs.git


More information about the x2go-commits mailing list