summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2011-09-26 22:35:48 -0400
committerMatt Turner <mattst88@gmail.com>2011-09-27 22:48:21 -0400
commit1036e32e006d496023553ea566cb13ae93933719 (patch)
tree8d20c71fed14ed2883fc883065272eb68ae2ee3c
parentee09a9a340f8946f2d4a71a431b64189dbb5c256 (diff)
Remove if(E != NULL) checks around free(E)
Reviewed-by: Jamey Sharp <jamey@minilop.net> Signed-off-by: Matt Turner <mattst88@gmail.com>
-rw-r--r--src/mga_dri.c24
-rw-r--r--src/mga_driver.c20
-rw-r--r--src/mga_merge.c6
-rw-r--r--src/mga_video.c3
4 files changed, 17 insertions, 36 deletions
diff --git a/src/mga_dri.c b/src/mga_dri.c
index 957c6df..1454994 100644
--- a/src/mga_dri.c
+++ b/src/mga_dri.c
@@ -1011,8 +1011,8 @@ static void MGADRIMoveBuffersXAA(WindowPtr pParent, DDXPointRec ptOldOrg,
pboxNew2 = (BoxPtr)malloc(sizeof(BoxRec)*nbox);
pptNew2 = (DDXPointPtr)malloc(sizeof(DDXPointRec)*nbox);
if (!pboxNew2 || !pptNew2) {
- if (pptNew2) free(pptNew2);
- if (pboxNew2) free(pboxNew2);
+ free(pptNew2);
+ free(pboxNew2);
if (pboxNew1) {
free(pptNew1);
free(pboxNew1);
@@ -1494,21 +1494,13 @@ void MGADRICloseScreen( ScreenPtr pScreen )
DRICloseScreen( pScreen );
if ( pMga->pDRIInfo ) {
- if ( pMga->pDRIInfo->devPrivate ) {
- free( pMga->pDRIInfo->devPrivate );
- pMga->pDRIInfo->devPrivate = 0;
- }
+ free(pMga->pDRIInfo->devPrivate);
+ pMga->pDRIInfo->devPrivate = 0;
DRIDestroyInfoRec( pMga->pDRIInfo );
pMga->pDRIInfo = 0;
}
- if ( pMga->DRIServerInfo ) {
- free(pMga->DRIServerInfo);
- pMga->DRIServerInfo = 0;
- }
- if ( pMga->pVisualConfigs ) {
- free(pMga->pVisualConfigs);
- }
- if ( pMga->pVisualConfigsPriv ) {
- free( pMga->pVisualConfigsPriv );
- }
+ free(pMga->DRIServerInfo);
+ pMga->DRIServerInfo = 0;
+ free(pMga->pVisualConfigs);
+ free(pMga->pVisualConfigsPriv);
}
diff --git a/src/mga_driver.c b/src/mga_driver.c
index d4ae346..dcbfabf 100644
--- a/src/mga_driver.c
+++ b/src/mga_driver.c
@@ -644,8 +644,6 @@ MGAGetRec(ScrnInfoPtr pScrn)
void
MGAFreeRec(ScrnInfoPtr pScrn)
{
- if (pScrn->driverPrivate == NULL)
- return;
free(pScrn->driverPrivate);
pScrn->driverPrivate = NULL;
}
@@ -2430,8 +2428,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags)
pMga->FbMapSize,
LOOKUP_BEST_REFRESH);
- if (linePitches)
- free(linePitches);
+ free(linePitches);
}
if (i < 1 && pMga->FBDev) {
@@ -3750,16 +3747,11 @@ MGACloseScreen(int scrnIndex, ScreenPtr pScreen)
#endif
if (pMga->CursorInfoRec)
xf86DestroyCursorInfoRec(pMga->CursorInfoRec);
- if (pMga->ShadowPtr)
- free(pMga->ShadowPtr);
- if (pMga->DGAModes)
- free(pMga->DGAModes);
- if (pMga->adaptor)
- free(pMga->adaptor);
- if (pMga->portPrivate)
- free(pMga->portPrivate);
- if (pMga->ScratchBuffer)
- free(pMga->ScratchBuffer);
+ free(pMga->ShadowPtr);
+ free(pMga->DGAModes);
+ free(pMga->adaptor);
+ free(pMga->portPrivate);
+ free(pMga->ScratchBuffer);
pScrn->vtSema = FALSE;
diff --git a/src/mga_merge.c b/src/mga_merge.c
index e3216c9..c1cf2eb 100644
--- a/src/mga_merge.c
+++ b/src/mga_merge.c
@@ -528,8 +528,7 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags)
pMga->FbMapSize,
LOOKUP_BEST_REFRESH);
- if (linePitches)
- free(linePitches);
+ free(linePitches);
}
@@ -892,8 +891,7 @@ MGACloseScreenMerged(int scrnIndex, ScreenPtr pScreen) {
pScrn1->currentMode = pScrn1->modes;
do {
DisplayModePtr p = pScrn1->currentMode->next;
- if(pScrn1->currentMode->Private)
- free(pScrn1->currentMode->Private);
+ free(pScrn1->currentMode->Private);
free(pScrn1->currentMode);
pScrn1->currentMode = p;
}while( pScrn1->currentMode != pScrn1->modes);
diff --git a/src/mga_video.c b/src/mga_video.c
index beb5a3c..784e7b1 100644
--- a/src/mga_video.c
+++ b/src/mga_video.c
@@ -146,8 +146,7 @@ void MGAInitVideo(ScreenPtr pScreen)
if(num_adaptors)
xf86XVScreenInit(pScreen, adaptors, num_adaptors);
- if(newAdaptors)
- free(newAdaptors);
+ free(newAdaptors);
}
/* client libraries expect an encoding */