aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2021-01-04 19:44:37 +0100
committerUlrich Sibiller <uli42@gmx.de>2021-01-15 19:50:37 +0100
commit5ad0b4dde3b686d369d222976e947dcd83058757 (patch)
treecfff32f6b03e0fc2ceffb20eb63e3be81389b341 /nx-X11/programs/Xserver
parent6214c71b32aa3562aeff08ffa63e67323a2cc05b (diff)
downloadnx-libs-5ad0b4dde3b686d369d222976e947dcd83058757.tar.gz
nx-libs-5ad0b4dde3b686d369d222976e947dcd83058757.tar.bz2
nx-libs-5ad0b4dde3b686d369d222976e947dcd83058757.zip
Window.c: check for malloc failure
PVS finding: "V522 There might be dereferencing of a potential null pointer 'nxagentConfiguredWindowList'."
Diffstat (limited to 'nx-X11/programs/Xserver')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Window.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index a30eac589..367c15841 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -3659,6 +3659,14 @@ void nxagentAddStaticResizedWindow(WindowPtr pWin, unsigned long sequence, int o
StaticResizedWindowStruct *tmp = nxagentStaticResizedWindowList;
nxagentStaticResizedWindowList = malloc(sizeof(StaticResizedWindowStruct));
+ if (!nxagentStaticResizedWindowList)
+ {
+ #ifdef WARNING
+ fprintf(stderr, "WARNING: could not allocate memory for nxagentStaticResizedWindowList\n");
+ #endif
+ nxagentStaticResizedWindowList = tmp;
+ return;
+ }
nxagentStaticResizedWindowList -> next = tmp;
nxagentStaticResizedWindowList -> prev = NULL;