aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2019-06-20 18:52:31 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2019-06-22 11:30:47 +0200
commitfd7e1f989b757667e7d7a3f0d08c9ee4b21a3a7c (patch)
tree6826dca9680d28666037cb751fb0249c038364a3
parent3c0469971a5092781783b6a5c86b668047e475be (diff)
downloadnx-libs-fd7e1f989b757667e7d7a3f0d08c9ee4b21a3a7c.tar.gz
nx-libs-fd7e1f989b757667e7d7a3f0d08c9ee4b21a3a7c.tar.bz2
nx-libs-fd7e1f989b757667e7d7a3f0d08c9ee4b21a3a7c.zip
Keyboard.c: rearrange code to make cppcheck happy
Otherwise it will (falsely) report "Memory pointed to by 'sessionpath' is freed twice."
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Keyboard.c5
1 files changed, 4 insertions, 1 deletions
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
{