Mesa (master): dri: Add assert to check for null pointer dereference.

Vinson Lee vlee at kemper.freedesktop.org
Sun Feb 28 00:51:52 UTC 2010


Module: Mesa
Branch: master
Commit: cab77711b3e8d398393677bcefcd413f50503a64
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cab77711b3e8d398393677bcefcd413f50503a64

Author: Vinson Lee <vlee at vmware.com>
Date:   Sat Feb 27 16:51:17 2010 -0800

dri: Add assert to check for null pointer dereference.

---

 src/mesa/drivers/dri/common/dri_util.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index a4fd002..890ae51 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -127,6 +127,7 @@ static int driUnbindContext(__DRIcontext *pcp)
     /* Let driver unbind drawable from context */
     (*psp->DriverAPI.UnbindContext)(pcp);
 
+    assert(pdp);
     if (pdp->refcount == 0) {
 	/* ERROR!!! */
 	return GL_FALSE;




More information about the mesa-commit mailing list