summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/graw-xlib
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2012-09-03 20:24:35 -0700
committerMatt Turner <mattst88@gmail.com>2012-09-05 22:28:50 -0700
commit5067506ea6ada5eeae33b1acf1c916e00121c12a (patch)
treea6b4ff2e3cf5fb6058101aee3b6f1dcd3f382c15 /src/gallium/targets/graw-xlib
parenta9e8054fffc6e3e6a5f108a96c331858c28a5862 (diff)
downloadexternal_mesa3d-5067506ea6ada5eeae33b1acf1c916e00121c12a.zip
external_mesa3d-5067506ea6ada5eeae33b1acf1c916e00121c12a.tar.gz
external_mesa3d-5067506ea6ada5eeae33b1acf1c916e00121c12a.tar.bz2
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 <brianp@vmware.com>
Diffstat (limited to 'src/gallium/targets/graw-xlib')
-rw-r--r--src/gallium/targets/graw-xlib/graw_xlib.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/gallium/targets/graw-xlib/graw_xlib.c b/src/gallium/targets/graw-xlib/graw_xlib.c
index 95b8568..6138cf6 100644
--- a/src/gallium/targets/graw-xlib/graw_xlib.c
+++ b/src/gallium/targets/graw-xlib/graw_xlib.c
@@ -157,8 +157,7 @@ fail:
if (xlib_handle)
FREE(xlib_handle);
- if (visinfo)
- free(visinfo);
+ free(visinfo);
if (win)
XDestroyWindow(graw.display, win);