diff options
author | Ulrich Sibiller <uli42@gmx.de> | 2020-01-25 22:55:00 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2020-05-07 14:57:15 +0200 |
commit | 9b56675dd10aee122c2a6a0c2351b8199a4aa3ba (patch) | |
tree | 7438b6e664d8c5f8c80c3a7126b2df73cd4731cf | |
parent | 434d50853d65d79bd10f742e1f4c6fa4e9f0e3c6 (diff) | |
download | nx-libs-9b56675dd10aee122c2a6a0c2351b8199a4aa3ba.tar.gz nx-libs-9b56675dd10aee122c2a6a0c2351b8199a4aa3ba.tar.bz2 nx-libs-9b56675dd10aee122c2a6a0c2351b8199a4aa3ba.zip |
Rootless.c: fix common realloc mistake
As reported by static analyzer:
(error) Common realloc mistake: 'ptr' nulled but not freed upon failure
Attributes ArcticaProject/nx-libs#905
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/Rootless.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c index da386d845..b0fda2fa2 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/Rootless.c +++ b/nx-X11/programs/Xserver/hw/nxagent/Rootless.c @@ -151,10 +151,9 @@ void nxagentRootlessAddTopLevelWindow(WindowPtr pWin, Window w) if (topLevelParentMap.next == topLevelParentMap.size) { - TopLevelParentRec *ptr = topLevelParentMap.elt; size_t size = (topLevelParentMap.size += TOP_LEVEL_TABLE_UNIT); - ptr = realloc(ptr, size * sizeof(TopLevelParentRec)); + TopLevelParentRec *ptr = realloc(topLevelParentMap.elt, size * sizeof(TopLevelParentRec)); if (ptr == NULL) { |