misc: fix more regressions and whitespace weirdness introduced in…

misc: fix more regressions and whitespace weirdness introduced in 913fcf1a.
parent 15f69488
......@@ -129,9 +129,11 @@ 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");
fprintf(f, "/*\n");
......
......@@ -980,10 +980,10 @@ 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
......@@ -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;
}
......
......@@ -2454,6 +2454,7 @@ SocketUNIXConnectPost:
ciptr->peeraddrlen = namelen;
memcpy (ciptr->addr, &sockname, ciptr->addrlen);
memcpy (ciptr->peeraddr, &sockname, ciptr->peeraddrlen);
return 0;
}
......
......@@ -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);
......
......@@ -628,15 +628,18 @@ 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]))
{
free(prect);
return;
}
}
pGC = screenContext[i];
newValues[SUBWINDOW].val = IncludeInferiors;
newValues[ABSX].val = pBgWin->drawable.x;
......
......@@ -995,9 +995,11 @@ ProcRenderCompositeGlyphs (ClientPtr client)
{
listsBase = (GlyphListPtr) malloc (nlist * sizeof (GlyphListRec));
if (!listsBase)
{
free(glyphsBase);
return BadAlloc;
}
}
elementsBase = malloc(nlist * sizeof(XGlyphElt8));
if (!elementsBase)
......
......@@ -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;
}
......
......@@ -766,14 +766,18 @@ 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;
newValues[ABSX].val = pBgWin->drawable.x;
......
......@@ -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;
......
......@@ -1346,10 +1346,13 @@ ProcRenderCompositeGlyphs (ClientPtr client)
{
listsBase = (GlyphListPtr) malloc (nlist * sizeof (GlyphListRec));
if (!listsBase)
{
free(glyphsBase);
free(listsBase);
return BadAlloc;
}
}
buffer = (CARD8 *) (stuff + 1);
glyphs = glyphsBase;
lists = listsBase;
......@@ -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);
}
return result;
}
......@@ -3037,8 +3043,9 @@ PanoramiXRenderTriangles(ClientPtr client)
if(result != Success) break;
}
}
free(extra);
}
return result;
}
......@@ -3090,8 +3097,9 @@ PanoramiXRenderTriStrip(ClientPtr client)
if(result != Success) break;
}
}
free(extra);
}
return result;
}
......@@ -3143,8 +3151,9 @@ PanoramiXRenderTriFan(ClientPtr client)
if(result != Success) break;
}
}
free(extra);
}
return result;
}
......@@ -3272,8 +3281,10 @@ PanoramiXRenderAddTraps (ClientPtr client)
result = (*PanoramiXSaveRenderVector[X_RenderAddTraps]) (client);
if(result != Success) break;
}
}
free(extra);
}
return result;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment