From fd7e1f989b757667e7d7a3f0d08c9ee4b21a3a7c Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 20 Jun 2019 18:52:31 +0200 Subject: Keyboard.c: rearrange code to make cppcheck happy Otherwise it will (falsely) report "Memory pointed to by 'sessionpath' is freed twice." --- nx-X11/programs/Xserver/hw/nxagent/Keyboard.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'nx-X11/programs/Xserver/hw') diff --git a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c index b2ae7dfd1..7330784de 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Keyboard.c @@ -1696,7 +1696,10 @@ static char* getKeyboardFilePath(void) free(sessionpath); FatalError("malloc for keyboard file path failed."); } - free(sessionpath); + else + { + free(sessionpath); + } } else { -- cgit v1.2.3