summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorDave Airlie <airliedfreedesktop.org>2006-03-23 04:13:37 +0000
committerDave Airlie <airliedfreedesktop.org>2006-03-23 04:13:37 +0000
commiteab896cc213157758d74a2f39b5e3b1e748c071f (patch)
treef91905adc3ba0ab6a79ad7aa507d321c82b3f7f9 /src/mesa
parentf756924fa59b53f4951e2f817144bcb5e5765535 (diff)
fix coverity 926: use before NULL check
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/common/dri_util.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index d7640759dee..883a89c8886 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -659,10 +659,12 @@ static void
driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate)
{
__DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *) drawablePrivate;
- __DRIscreenPrivate *psp = pdp->driScreenPriv;
- int scrn = psp->myNum;
+ __DRIscreenPrivate *psp;
+ int scrn;
if (pdp) {
+ psp = pdp->driScreenPriv;
+ scrn = psp->myNum;
(*psp->DriverAPI.DestroyBuffer)(pdp);
if ((*dri_interface->windowExists)(dpy, pdp->draw))
(void)(*dri_interface->destroyDrawable)(dpy, scrn, pdp->draw);