aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/programs/Xserver/hw/nxagent/Window.c
diff options
context:
space:
mode:
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent/Window.c')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Window.c43
1 files changed, 30 insertions, 13 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Window.c b/nx-X11/programs/Xserver/hw/nxagent/Window.c
index e1a0776ad..d95f8f3ed 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Window.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Window.c
@@ -3088,27 +3088,36 @@ static void nxagentReconnectWindow(void * param0, XID param1, void * data_buffer
(void*)pWin, pWin -> drawable.id, nxagentWindow(pWin));
#endif
+ /* FIXME: use XAllocSizeHints() */
#ifdef _XSERVER64
data64 = (unsigned char *) malloc(sizeof(XSizeHints) + 4);
+ if (data64)
+ {
+ for (int i = 0; i < 4; i++)
+ {
+ *(data64 + i) = *(data + i);
+ }
- for (int i = 0; i < 4; i++)
- {
- *(data64 + i) = *(data + i);
- }
-
- *(((int *) data64) + 1) = 0;
+ *(((int *) data64) + 1) = 0;
- for (int i = 8; i < sizeof(XSizeHints) + 4; i++)
- {
- *(data64 + i) = *(data + i - 4);
- }
+ for (int i = 8; i < sizeof(XSizeHints) + 4; i++)
+ {
+ *(data64 + i) = *(data + i - 4);
+ }
- XSizeHints *props = (XSizeHints *) data64;
+ XSizeHints *props = (XSizeHints *) data64;
#else
- XSizeHints *props = (XSizeHints *) data;
+ XSizeHints *props = (XSizeHints *) data;
#endif /* _XSERVER64 */
- hints = *props;
+ hints = *props;
+ }
+ else
+ {
+ #ifdef WARNING
+ fprintf(stderr, "%s: Failed to alloc memory for XSizeHints\n", __func__);
+ #endif
+ }
}
else
{
@@ -3657,6 +3666,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;