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/mesa/vbo/vbo_save_api.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/mesa/vbo/vbo_save_api.c')
-rw-r--r-- | src/mesa/vbo/vbo_save_api.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c index 636aa1fdb7e..f7936610c1c 100644 --- a/src/mesa/vbo/vbo_save_api.c +++ b/src/mesa/vbo/vbo_save_api.c @@ -1577,10 +1577,8 @@ vbo_destroy_vertex_list(struct gl_context *ctx, void *data) if (--node->prim_store->refcount == 0) free(node->prim_store); - if (node->current_data) { - free(node->current_data); - node->current_data = NULL; - } + free(node->current_data); + node->current_data = NULL; } |