diff options
Diffstat (limited to 'src/glx')
-rw-r--r-- | src/glx/dri2_glx.c | 6 | ||||
-rw-r--r-- | src/glx/dri_glx.c | 6 | ||||
-rw-r--r-- | src/glx/drisw_glx.c | 3 | ||||
-rw-r--r-- | src/glx/glxext.c | 9 | ||||
-rw-r--r-- | src/glx/indirect_glx.c | 12 | ||||
-rw-r--r-- | src/glx/indirect_vertex_array.c | 12 |
6 files changed, 16 insertions, 32 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index 7978bfd4633..5644f665c4c 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -126,8 +126,7 @@ dri2_destroy_context(struct glx_context *context) driReleaseDrawables(&pcp->base); - if (context->extensions) - free((char *) context->extensions); + free((char *) context->extensions); (*psc->core->destroyContext) (pcp->driContext); @@ -313,8 +312,7 @@ dri2_create_context_attribs(struct glx_screen *base, return &pcp->base; error_exit: - if (pcp != NULL) - free(pcp); + free(pcp); return NULL; } diff --git a/src/glx/dri_glx.c b/src/glx/dri_glx.c index b2fced95222..a158de023ba 100644 --- a/src/glx/dri_glx.c +++ b/src/glx/dri_glx.c @@ -495,8 +495,7 @@ CallCreateNewScreen(Display *dpy, int scrn, struct dri_screen *psc, if (framebuffer.base != MAP_FAILED) drmUnmap((drmAddress) framebuffer.base, framebuffer.size); - if (framebuffer.dev_priv != NULL) - free(framebuffer.dev_priv); + free(framebuffer.dev_priv); if (fd >= 0) drmCloseOnce(fd); @@ -516,8 +515,7 @@ dri_destroy_context(struct glx_context * context) driReleaseDrawables(&pcp->base); - if (context->extensions) - free((char *) context->extensions); + free((char *) context->extensions); (*psc->core->destroyContext) (pcp->driContext); diff --git a/src/glx/drisw_glx.c b/src/glx/drisw_glx.c index d98fdb903d0..b68e62272c7 100644 --- a/src/glx/drisw_glx.c +++ b/src/glx/drisw_glx.c @@ -255,8 +255,7 @@ drisw_destroy_context(struct glx_context *context) driReleaseDrawables(&pcp->base); - if (context->extensions) - free((char *) context->extensions); + free((char *) context->extensions); (*psc->core->destroyContext) (pcp->driContext); diff --git a/src/glx/glxext.c b/src/glx/glxext.c index 3827b583b7a..729ca5f073c 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -230,10 +230,8 @@ glx_display_free(struct glx_display *priv) } FreeScreenConfigs(priv); - if (priv->serverGLXvendor) - free((char *) priv->serverGLXvendor); - if (priv->serverGLXversion) - free((char *) priv->serverGLXversion); + free((char *) priv->serverGLXvendor); + free((char *) priv->serverGLXversion); __glxHashDestroy(priv->glXDrawHash); @@ -740,8 +738,7 @@ glx_screen_cleanup(struct glx_screen *psc) { if (psc->configs) { glx_config_destroy_list(psc->configs); - if (psc->effectiveGLXexts) - free(psc->effectiveGLXexts); + free(psc->effectiveGLXexts); psc->configs = NULL; /* NOTE: just for paranoia */ } if (psc->visuals) { diff --git a/src/glx/indirect_glx.c b/src/glx/indirect_glx.c index 53d5a914db7..5eef59c1d5a 100644 --- a/src/glx/indirect_glx.c +++ b/src/glx/indirect_glx.c @@ -45,14 +45,10 @@ indirect_destroy_context(struct glx_context *gc) { __glXFreeVertexArrayState(gc); - if (gc->vendor) - free((char *) gc->vendor); - if (gc->renderer) - free((char *) gc->renderer); - if (gc->version) - free((char *) gc->version); - if (gc->extensions) - free((char *) gc->extensions); + free((char *) gc->vendor); + free((char *) gc->renderer); + free((char *) gc->version); + free((char *) gc->extensions); __glFreeAttributeState(gc); free((char *) gc->buf); free((char *) gc->client_state_private); diff --git a/src/glx/indirect_vertex_array.c b/src/glx/indirect_vertex_array.c index 115f755bb7d..3f7ab679429 100644 --- a/src/glx/indirect_vertex_array.c +++ b/src/glx/indirect_vertex_array.c @@ -115,14 +115,10 @@ __glXFreeVertexArrayState(struct glx_context * gc) struct array_state_vector *arrays = state->array_state; if (arrays) { - if (arrays->stack) { - free(arrays->stack); - arrays->stack = NULL; - } - if (arrays->arrays) { - free(arrays->arrays); - arrays->arrays = NULL; - } + free(arrays->stack); + arrays->stack = NULL; + free(arrays->arrays); + arrays->arrays = NULL; free(arrays); state->array_state = NULL; } |