commit 19b490b05442a0af495ceb73c131d4b516e773fe Author: Oppen Date: Tue Dec 3 00:37:43 2013 -0300 Fix NULL dereference. diff --git a/src/via_exa.c b/src/via_exa.c index d78a770..1164e2c 100644 --- a/src/via_exa.c +++ b/src/via_exa.c @@ -217,7 +217,10 @@ viaSetupCBuffer(ScrnInfoPtr pScrn, ViaCommandBuffer *cb, unsigned size) static void viaTearDownCBuffer(ViaCommandBuffer *cb) { - if (cb && cb->buf) + if (!cb) + return; + + if (cb->buf) free(cb->buf); cb->buf = NULL; } commit 3c113fbc90c290a560f89bba0f6e1183c4f0f530 Author: Oppen Date: Tue Dec 3 00:28:13 2013 -0300 Fix double free. diff --git a/src/via_driver.c b/src/via_driver.c index 0f24ebe..352f89b 100644 --- a/src/via_driver.c +++ b/src/via_driver.c @@ -1026,7 +1026,9 @@ VIAPreInit(ScrnInfoPtr pScrn, int flags) pVia->ChipRev = pciReadByte(pciTag(0, 0, 0), 0xF6); #endif } - free(pEnt); + + if (pEnt) + free(pEnt); xf86DrvMsg(pScrn->scrnIndex, from, "Chipset revision: %d\n", pVia->ChipRev); pVia->directRenderingType = DRI_NONE; commit 151b7a1c884f2f84cb552346b7c8704faf9877b0 Author: Oppen Date: Tue Dec 3 00:27:49 2013 -0300 Fix NULL dereference. diff --git a/src/via_3d.c b/src/via_3d.c index 64f40ba..e2d04ff 100644 --- a/src/via_3d.c +++ b/src/via_3d.c @@ -257,8 +257,12 @@ viaSet3DCompositeOperator(Via3DState * v3d, CARD8 op) { ViaCompositeOperator *vOp = viaOperatorModes + op; - v3d->blendDirty = TRUE; - if (v3d && vOp->supported) { + if (v3d) + v3d->blendDirty = TRUE; + else + return; + + if (vOp->supported) { v3d->blendCol0 = vOp->col0 << 4; v3d->blendCol1 = vOp->col1 << 2; v3d->blendAl0 = vOp->al0 << 4; commit b895908d5bcfc3261bfaa69040df22ad55ca5d86 Author: Oppen Date: Tue Dec 3 00:27:17 2013 -0300 Fix memory leak. diff --git a/src/via_dri.c b/src/via_dri.c index c8d3180..2f21a2b 100644 --- a/src/via_dri.c +++ b/src/via_dri.c @@ -478,6 +478,14 @@ VIAInitVisualConfigs(ScreenPtr pScreen) if (i != numConfigs) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "[dri] Incorrect " "initialization of visuals. Disabling DRI.\n"); + + if (pConfigs) + free(pConfigs); + if (pVIAConfigs) + free(pVIAConfigs); + if (pVIAConfigPtrs) + free(pVIAConfigPtrs); + return FALSE; } }