diff options
author | Matt Turner <[email protected]> | 2012-09-03 20:24:35 -0700 |
---|---|---|
committer | Matt Turner <[email protected]> | 2012-09-05 22:28:50 -0700 |
commit | 5067506ea6ada5eeae33b1acf1c916e00121c12a (patch) | |
tree | a6b4ff2e3cf5fb6058101aee3b6f1dcd3f382c15 /src/glx/glxext.c | |
parent | a9e8054fffc6e3e6a5f108a96c331858c28a5862 (diff) |
Remove useless checks for NULL before freeing
This patch has been generated by the following Coccinelle semantic
patch:
// Remove useless checks for NULL before freeing
//
// free (NULL) is a no-op, so there is no need to avoid it
@@
expression E;
@@
+ free (E);
+ E = NULL;
- if (unlikely (E != NULL)) {
- free(E);
(
- E = NULL;
|
- E = 0;
)
...
- }
@@
expression E;
type T;
@@
+ free ((T) E);
+ E = NULL;
- if (unlikely (E != NULL)) {
- free((T) E);
(
- E = NULL;
|
- E = 0;
)
...
- }
@@
expression E;
@@
+ free (E);
- if (unlikely (E != NULL)) {
- free (E);
- }
@@
expression E;
type T;
@@
+ free ((T) E);
- if (unlikely (E != NULL)) {
- free ((T) E);
- }
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/glx/glxext.c')
-rw-r--r-- | src/glx/glxext.c | 9 |
1 files changed, 3 insertions, 6 deletions
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) { |