diff options
-rw-r--r-- | doc/libNX_X11/lcUniConv/8bit_tab_to_h.c | 2 | ||||
-rw-r--r-- | nx-X11/lib/include/xtrans/Xtrans.c | 10 | ||||
-rw-r--r-- | nx-X11/lib/include/xtrans/Xtranssock.c | 3 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/Xi/exevents.c | 3 | ||||
-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 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/miexpose.c | 4 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/mi/mizerline.c | 3 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/render/render.c | 27 |
10 files changed, 53 insertions, 18 deletions
diff --git a/doc/libNX_X11/lcUniConv/8bit_tab_to_h.c b/doc/libNX_X11/lcUniConv/8bit_tab_to_h.c index 469ec05bb..97086f8e4 100644 --- a/doc/libNX_X11/lcUniConv/8bit_tab_to_h.c +++ b/doc/libNX_X11/lcUniConv/8bit_tab_to_h.c @@ -129,8 +129,10 @@ int main (int argc, char *argv[]) strcpy(fname,directory); strcat(fname,filename); f = fopen(fname,"w"); if (f == NULL) + { free(fname); exit(1); + } } fprintf(f, "\n"); diff --git a/nx-X11/lib/include/xtrans/Xtrans.c b/nx-X11/lib/include/xtrans/Xtrans.c index aa9646261..3665c8d78 100644 --- a/nx-X11/lib/include/xtrans/Xtrans.c +++ b/nx-X11/lib/include/xtrans/Xtrans.c @@ -980,17 +980,17 @@ TRANS(GetMyAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, { prmsg (1,"GetMyAddr: malloc failed\n"); return -1; - } else { - memcpy(*addrp, ciptr->addr, ciptr->addrlen); - free(addrp); } + + memcpy(*addrp, ciptr->addr, ciptr->addrlen); + return 0; } #endif int TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, - Xtransaddr **addrp) + Xtransaddr **addrp) { prmsg (2,"GetPeerAddr(%d)\n", ciptr->fd); @@ -1003,7 +1003,9 @@ TRANS(GetPeerAddr) (XtransConnInfo ciptr, int *familyp, int *addrlenp, prmsg (1,"GetPeerAddr: malloc failed\n"); return -1; } + memcpy(*addrp, ciptr->peeraddr, ciptr->peeraddrlen); + return 0; } diff --git a/nx-X11/lib/include/xtrans/Xtranssock.c b/nx-X11/lib/include/xtrans/Xtranssock.c index 090a325ce..47c0a0409 100644 --- a/nx-X11/lib/include/xtrans/Xtranssock.c +++ b/nx-X11/lib/include/xtrans/Xtranssock.c @@ -2442,7 +2442,7 @@ SocketUNIXConnectPost: (ciptr->peeraddr = malloc(namelen)) == NULL) { prmsg (1, - "SocketUNIXCreateListener: Can't allocate space for the addr\n"); + "SocketUNIXCreateListener: Can't allocate space for the addr\n"); return TRANS_CONNECT_FAILED; } @@ -2454,6 +2454,7 @@ SocketUNIXConnectPost: ciptr->peeraddrlen = namelen; memcpy (ciptr->addr, &sockname, ciptr->addrlen); memcpy (ciptr->peeraddr, &sockname, ciptr->peeraddrlen); + return 0; } diff --git a/nx-X11/programs/Xserver/Xi/exevents.c b/nx-X11/programs/Xserver/Xi/exevents.c index 1991d1b29..e614b5af9 100644 --- a/nx-X11/programs/Xserver/Xi/exevents.c +++ b/nx-X11/programs/Xserver/Xi/exevents.c @@ -655,9 +655,10 @@ AddExtensionClient(WindowPtr pWin, ClientPtr client, Mask mask, int mskidx) others = (InputClients *) malloc(sizeof(InputClients)); if (!others) return BadAlloc; - if (!pWin->optional->inputMasks && !MakeInputMasks(pWin)) + if (!pWin->optional->inputMasks && !MakeInputMasks(pWin)) { free(others); return BadAlloc; + } bzero((char *)&others->mask[0], sizeof(Mask) * EMASKSIZE); others->mask[mskidx] = mask; others->resource = FakeClientID(client->index); 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; } diff --git a/nx-X11/programs/Xserver/mi/miexpose.c b/nx-X11/programs/Xserver/mi/miexpose.c index a302bf578..9135d2e6e 100644 --- a/nx-X11/programs/Xserver/mi/miexpose.c +++ b/nx-X11/programs/Xserver/mi/miexpose.c @@ -766,13 +766,17 @@ int what; screenContext[i] = CreateGC((DrawablePtr)pWin, (BITS32) 0, (XID *)NULL, &status); if (!screenContext[i]) + { free(prect); return; + } numGCs++; if (!AddResource(FakeClientID(0), ResType, (void *)screenContext[i])) + { free(prect); return; + } } pGC = screenContext[i]; newValues[SUBWINDOW].val = IncludeInferiors; diff --git a/nx-X11/programs/Xserver/mi/mizerline.c b/nx-X11/programs/Xserver/mi/mizerline.c index c68e2c9a3..ee473f78d 100644 --- a/nx-X11/programs/Xserver/mi/mizerline.c +++ b/nx-X11/programs/Xserver/mi/mizerline.c @@ -158,9 +158,12 @@ miZeroLine(pDraw, pGC, mode, npt, pptInit) pspanInit = (DDXPointPtr)malloc(list_len * sizeof(DDXPointRec)); pwidthInit = (int *)malloc(list_len * sizeof(int)); if (!pspanInit || !pwidthInit) + { free(pspanInit); free(pwidthInit); + return; + } Nspans = 0; new_span = TRUE; diff --git a/nx-X11/programs/Xserver/render/render.c b/nx-X11/programs/Xserver/render/render.c index 65ca41881..3c1cbe53c 100644 --- a/nx-X11/programs/Xserver/render/render.c +++ b/nx-X11/programs/Xserver/render/render.c @@ -1346,9 +1346,12 @@ ProcRenderCompositeGlyphs (ClientPtr client) { listsBase = (GlyphListPtr) malloc (nlist * sizeof (GlyphListRec)); if (!listsBase) + { free(glyphsBase); free(listsBase); + return BadAlloc; + } } buffer = (CARD8 *) (stuff + 1); glyphs = glyphsBase; @@ -2920,6 +2923,8 @@ PanoramiXRenderFillRectangles (ClientPtr client) result = (*PanoramiXSaveRenderVector[X_RenderFillRectangles]) (client); if(result != Success) break; } + + free(extra); } return result; } @@ -2979,9 +2984,10 @@ PanoramiXRenderTrapezoids(ClientPtr client) if(result != Success) break; } + + free(extra); } - free(extra); return result; } @@ -3036,9 +3042,10 @@ PanoramiXRenderTriangles(ClientPtr client) if(result != Success) break; } - + + free(extra); } - free(extra); + return result; } @@ -3089,9 +3096,10 @@ PanoramiXRenderTriStrip(ClientPtr client) if(result != Success) break; } - + + free(extra); } - free(extra); + return result; } @@ -3142,9 +3150,10 @@ PanoramiXRenderTriFan(ClientPtr client) if(result != Success) break; } - + + free(extra); } - free(extra); + return result; } @@ -3272,8 +3281,10 @@ PanoramiXRenderAddTraps (ClientPtr client) result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client); if(result != Success) break; } + + free(extra); } - free(extra); + return result; } |