summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZack Rusin <zack@kde.org>2009-06-20 21:25:47 -0400
committerZack Rusin <zack@kde.org>2009-07-06 17:21:37 -0400
commitf311893bf4cd4e20e5b43fa404c4a2f656791943 (patch)
tree252dbdc3ff5a23b33612d3d64fdd7ceb4a31b67b
parent4873031e29e0e8f654f78307e6ec885e68a54d86 (diff)
downloadexternal_mesa3d-f311893bf4cd4e20e5b43fa404c4a2f656791943.zip
external_mesa3d-f311893bf4cd4e20e5b43fa404c4a2f656791943.tar.gz
external_mesa3d-f311893bf4cd4e20e5b43fa404c4a2f656791943.tar.bz2
cso: possible null pointer dereference
reported by clang static analyzer
-rw-r--r--src/gallium/auxiliary/cso_cache/cso_cache.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/cso_cache/cso_cache.c b/src/gallium/auxiliary/cso_cache/cso_cache.c
index 0bc77a5..e6dce3f 100644
--- a/src/gallium/auxiliary/cso_cache/cso_cache.c
+++ b/src/gallium/auxiliary/cso_cache/cso_cache.c
@@ -361,6 +361,10 @@ void cso_for_each_state(struct cso_cache *sc, enum cso_cache_type type,
void cso_cache_delete(struct cso_cache *sc)
{
assert(sc);
+
+ if (!sc)
+ return;
+
/* delete driver data */
cso_for_each_state(sc, CSO_BLEND, delete_blend_state, 0);
cso_for_each_state(sc, CSO_DEPTH_STENCIL_ALPHA, delete_depth_stencil_state, 0);