diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-02 14:11:38 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2016-07-02 14:11:38 +0200 |
commit | 1dbd3c888a3eee51db5303bd93e95b84999f5d31 (patch) | |
tree | 84db92271726b42b8c0864c8b7c77b2330566fc1 /nx-X11/programs/Xserver/dbe | |
parent | 279d37127db241a9ee685f6b671f51aa21a972ea (diff) | |
parent | e85808245810d0cc6918104deef25213d5f9e06c (diff) | |
download | nx-libs-1dbd3c888a3eee51db5303bd93e95b84999f5d31.tar.gz nx-libs-1dbd3c888a3eee51db5303bd93e95b84999f5d31.tar.bz2 nx-libs-1dbd3c888a3eee51db5303bd93e95b84999f5d31.zip |
Merge branch 'sunweaver-pr/backport-Xorg-memory-handling' into 3.6.x
Attributes GH PR #159: https://github.com/ArcticaProject/nx-libs/pull/159
Reviewed by: Vadim Troshchinskiy <vadim@qindel.com> -- Fri, 01 Jul 2016 12:47:46 -0700
Diffstat (limited to 'nx-X11/programs/Xserver/dbe')
-rw-r--r-- | nx-X11/programs/Xserver/dbe/dbe.c | 58 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dbe/midbe.c | 2 |
2 files changed, 30 insertions, 30 deletions
diff --git a/nx-X11/programs/Xserver/dbe/dbe.c b/nx-X11/programs/Xserver/dbe/dbe.c index 064987dec..5687f3d56 100644 --- a/nx-X11/programs/Xserver/dbe/dbe.c +++ b/nx-X11/programs/Xserver/dbe/dbe.c @@ -176,7 +176,7 @@ DbeAllocWinPriv(pScreen) register int i; pDbeScreenPriv = DBE_SCREEN_PRIV(pScreen); - pDbeWindowPriv = (DbeWindowPrivPtr)xalloc(pDbeScreenPriv->totalWinPrivSize); + pDbeWindowPriv = (DbeWindowPrivPtr)malloc(pDbeScreenPriv->totalWinPrivSize); if (pDbeWindowPriv) { @@ -268,7 +268,7 @@ DbeAllocWinPrivPriv(pScreen, index, amount) if (index >= pDbeScreenPriv->winPrivPrivLen) { unsigned *nsizes; - nsizes = (unsigned *)xrealloc(pDbeScreenPriv->winPrivPrivSizes, + nsizes = (unsigned *)realloc(pDbeScreenPriv->winPrivPrivSizes, (index + 1) * sizeof(unsigned)); if (!nsizes) { @@ -476,7 +476,7 @@ ProcDbeAllocateBackBufferName(client) } /* Free what was allocated by the GetVisualInfo() call above. */ - xfree(scrVisInfo.visinfo); + free(scrVisInfo.visinfo); if (!visualMatched) { @@ -499,7 +499,7 @@ ProcDbeAllocateBackBufferName(client) if (!AddResource(stuff->buffer, dbeWindowPrivResType, (void *)pDbeWindowPriv)) { - xfree(pDbeWindowPriv); + free(pDbeWindowPriv); return(BadAlloc); } @@ -564,7 +564,7 @@ ProcDbeAllocateBackBufferName(client) } /* malloc/realloc a new array and initialize all elements to 0. */ - pDbeWindowPriv->IDs = (XID *)xrealloc(pIDs, + pDbeWindowPriv->IDs = (XID *)realloc(pIDs, (pDbeWindowPriv->maxAvailableIDs+DBE_INCR_MAX_IDS)*sizeof(XID)); if (!pDbeWindowPriv->IDs) { @@ -610,7 +610,7 @@ ProcDbeAllocateBackBufferName(client) /* The DDX buffer allocation routine failed for the first buffer of * this window. */ - xfree(pDbeWindowPriv); + free(pDbeWindowPriv); return(status); } @@ -746,7 +746,7 @@ ProcDbeSwapBuffers(client) dbeSwapInfo = (xDbeSwapInfo *)&stuff[1]; /* Allocate array to record swap information. */ - swapInfo = (DbeSwapInfoPtr)Xalloc(nStuff * sizeof(DbeSwapInfoRec)); + swapInfo = (DbeSwapInfoPtr)malloc(nStuff * sizeof(DbeSwapInfoRec)); if (swapInfo == NULL) { return(BadAlloc); @@ -761,14 +761,14 @@ ProcDbeSwapBuffers(client) if (!(pWin = SecurityLookupWindow(dbeSwapInfo[i].window, client, SecurityWriteAccess))) { - Xfree(swapInfo); + free(swapInfo); return(BadWindow); } /* Each window must be double-buffered - BadMatch. */ if (DBE_WINDOW_PRIV(pWin) == NULL) { - Xfree(swapInfo); + free(swapInfo); return(BadMatch); } @@ -777,7 +777,7 @@ ProcDbeSwapBuffers(client) { if (dbeSwapInfo[i].window == dbeSwapInfo[j].window) { - Xfree(swapInfo); + free(swapInfo); return(BadMatch); } } @@ -788,7 +788,7 @@ ProcDbeSwapBuffers(client) (dbeSwapInfo[i].swapAction != XdbeUntouched ) && (dbeSwapInfo[i].swapAction != XdbeCopied )) { - Xfree(swapInfo); + free(swapInfo); return(BadValue); } @@ -818,12 +818,12 @@ ProcDbeSwapBuffers(client) error = (*pDbeScreenPriv->SwapBuffers)(client, &nStuff, swapInfo); if (error != Success) { - Xfree(swapInfo); + free(swapInfo); return(error); } } - Xfree(swapInfo); + free(swapInfo); return(Success); } /* ProcDbeSwapBuffers() */ @@ -912,7 +912,7 @@ ProcDbeGetVisualInfo(client) /* Make sure any specified drawables are valid. */ if (stuff->n != 0) { - if (!(pDrawables = (DrawablePtr *)Xalloc(stuff->n * + if (!(pDrawables = (DrawablePtr *)malloc(stuff->n * sizeof(DrawablePtr)))) { return(BadAlloc); @@ -925,19 +925,19 @@ ProcDbeGetVisualInfo(client) if (!(pDrawables[i] = (DrawablePtr)SecurityLookupDrawable( drawables[i], client, SecurityReadAccess))) { - Xfree(pDrawables); + free(pDrawables); return(BadDrawable); } } } count = (stuff->n == 0) ? screenInfo.numScreens : stuff->n; - if (!(pScrVisInfo = (XdbeScreenVisualInfo *)xalloc(count * + if (!(pScrVisInfo = (XdbeScreenVisualInfo *)malloc(count * sizeof(XdbeScreenVisualInfo)))) { if (pDrawables) { - Xfree(pDrawables); + free(pDrawables); } return(BadAlloc); @@ -958,13 +958,13 @@ ProcDbeGetVisualInfo(client) /* Free visinfos that we allocated for previous screen infos.*/ for (j = 0; j < i; j++) { - xfree(pScrVisInfo[j].visinfo); + free(pScrVisInfo[j].visinfo); } /* Free pDrawables if we needed to allocate it above. */ if (pDrawables) { - Xfree(pDrawables); + free(pDrawables); } return(BadAlloc); @@ -1039,13 +1039,13 @@ ProcDbeGetVisualInfo(client) /* Clean up memory. */ for (i = 0; i < count; i++) { - xfree(pScrVisInfo[i].visinfo); + free(pScrVisInfo[i].visinfo); } - xfree(pScrVisInfo); + free(pScrVisInfo); if (pDrawables) { - Xfree(pDrawables); + free(pDrawables); } return(client->noClientException); @@ -1640,7 +1640,7 @@ DbeWindowPrivDelete(pDbeWinPriv, id) DBE_INIT_MAX_IDS * sizeof(XID)); /* Free the extended array; use the static array. */ - xfree(pDbeWindowPriv->IDs); + free(pDbeWindowPriv->IDs); pDbeWindowPriv->IDs = pDbeWindowPriv->initIDs; pDbeWindowPriv->maxAvailableIDs = DBE_INIT_MAX_IDS; } @@ -1671,7 +1671,7 @@ DbeWindowPrivDelete(pDbeWinPriv, id) (void *)NULL; /* We are done with the window priv. */ - xfree(pDbeWindowPriv); + free(pDbeWindowPriv); } return(Success); @@ -1719,10 +1719,10 @@ DbeResetProc(extEntry) if (pDbeScreenPriv->winPrivPrivSizes) { - xfree(pDbeScreenPriv->winPrivPrivSizes); + free(pDbeScreenPriv->winPrivPrivSizes); } - xfree(pDbeScreenPriv); + free(pDbeScreenPriv); } } @@ -1874,7 +1874,7 @@ DbeExtensionInit() if (!AllocateWindowPrivate(pScreen, dbeWindowPrivIndex, 0) || !(pDbeScreenPriv = - (DbeScreenPrivPtr)Xcalloc(sizeof(DbeScreenPrivRec)))) + (DbeScreenPrivPtr)calloc(1, sizeof(DbeScreenPrivRec)))) { /* If we can not alloc a window or screen private, * then free any privates that we already alloc'ed and return @@ -1882,7 +1882,7 @@ DbeExtensionInit() for (j = 0; j < i; j++) { - xfree(screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr); + free(screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr); screenInfo.screens[j]->devPrivates[dbeScreenPrivIndex].ptr = NULL; } return; @@ -1986,7 +1986,7 @@ DbeExtensionInit() for (i = 0; i < screenInfo.numScreens; i++) { - xfree(screenInfo.screens[i]->devPrivates[dbeScreenPrivIndex].ptr); + free(screenInfo.screens[i]->devPrivates[dbeScreenPrivIndex].ptr); pScreen->devPrivates[dbeScreenPrivIndex].ptr = NULL; } return; diff --git a/nx-X11/programs/Xserver/dbe/midbe.c b/nx-X11/programs/Xserver/dbe/midbe.c index b8383e11a..c83b42771 100644 --- a/nx-X11/programs/Xserver/dbe/midbe.c +++ b/nx-X11/programs/Xserver/dbe/midbe.c @@ -115,7 +115,7 @@ miDbeGetVisualInfo(pScreen, pScrVisInfo) } /* Allocate an array of XdbeVisualInfo items. */ - if (!(visInfo = (XdbeVisualInfo *)xalloc(count * sizeof(XdbeVisualInfo)))) + if (!(visInfo = (XdbeVisualInfo *)malloc(count * sizeof(XdbeVisualInfo)))) { return(FALSE); /* memory alloc failure */ } |