fix coverity 926: use before NULL check

This commit is contained in:
Dave Airlie
2006-03-23 04:13:37 +00:00
parent f756924fa5
commit eab896cc21

View File

@@ -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);