From eab896cc213157758d74a2f39b5e3b1e748c071f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 23 Mar 2006 04:13:37 +0000 Subject: [PATCH] fix coverity 926: use before NULL check --- src/mesa/drivers/dri/common/dri_util.c | 6 ++++-- 1 file 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); -- 2.30.2