diff options
Diffstat (limited to 'nx-X11/programs/Xserver/hw/nxagent')
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c | 7 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/NXrender.c | 2 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/hw/nxagent/compext/Png.c | 10 |
3 files changed, 15 insertions, 4 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c index a51ae6fcc..48b565564 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXmiexpose.c @@ -628,14 +628,17 @@ int what; return; screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0, (XID *)NULL, &status); - if (!screenContext[i]) + if (!screenContext[i]) { free(prect); return; + } numGCs++; if (!AddResource(FakeClientID(0), ResType, - (void *)screenContext[i])) + (void *)screenContext[i])) + { free(prect); return; + } } pGC = screenContext[i]; newValues[SUBWINDOW].val = IncludeInferiors; diff --git a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c index 8937e2e7d..ce4ea9d5f 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/NXrender.c +++ b/nx-X11/programs/Xserver/hw/nxagent/NXrender.c @@ -995,8 +995,10 @@ ProcRenderCompositeGlyphs (ClientPtr client) { listsBase = (GlyphListPtr) malloc (nlist * sizeof (GlyphListRec)); if (!listsBase) + { free(glyphsBase); return BadAlloc; + } } elementsBase = malloc(nlist * sizeof(XGlyphElt8)); diff --git a/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c b/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c index 91412baa1..0a258c5a3 100644 --- a/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c +++ b/nx-X11/programs/Xserver/hw/nxagent/compext/Png.c @@ -330,6 +330,7 @@ char *PngCompressData(XImage *image, int *compressed_size) png_destroy_write_struct(&png_ptr, NULL); free(image_index); + return NULL; } @@ -340,8 +341,8 @@ char *PngCompressData(XImage *image, int *compressed_size) #endif png_destroy_write_struct(&png_ptr, &info_ptr); - free(image_index); + return NULL; } @@ -364,6 +365,7 @@ char *PngCompressData(XImage *image, int *compressed_size) #endif free(image_index); + return NULL; } @@ -376,8 +378,8 @@ char *PngCompressData(XImage *image, int *compressed_size) #endif png_destroy_write_struct(&png_ptr, &info_ptr); - free(pngCompBuf); + return NULL; } @@ -474,6 +476,7 @@ char *PngCompressData(XImage *image, int *compressed_size) free(pngCompBuf); free(image_index); + return NULL; } @@ -487,7 +490,9 @@ char *PngCompressData(XImage *image, int *compressed_size) fprintf(stderr, "******PngCompressData: PANIC! Cannot allocate [%d] bytes.\n", (int) (w * sizeof(CARD8))); #endif + free(image_index); + return NULL; } @@ -520,6 +525,7 @@ char *PngCompressData(XImage *image, int *compressed_size) free(pngCompBuf); free(image_index); + return NULL; } |