diff options
author | Andrea Canciani <ranma42@gmail.com> | 2011-07-30 11:04:16 +0200 |
---|---|---|
committer | Andrea Canciani <ranma42@gmail.com> | 2011-07-31 16:46:36 +0200 |
commit | e04e3687485a1988fd4084cca07ca4db4e2e7b96 (patch) | |
tree | 8fb5f5e81fa641f2b7e4bb7c4186151394b538fa /src/cairo-gstate.c | |
parent | 8f8da19fd47a51724e035a076628d38fde48863c (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;
@@
+ free (E);
- if (unlikely (E != NULL)) {
- free (E);
- }
Diffstat (limited to 'src/cairo-gstate.c')
-rw-r--r-- | src/cairo-gstate.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cairo-gstate.c b/src/cairo-gstate.c index 11a7b517..1d59fc54 100644 --- a/src/cairo-gstate.c +++ b/src/cairo-gstate.c @@ -517,8 +517,7 @@ _cairo_gstate_set_dash (cairo_gstate_t *gstate, const double *dash, int num_dash unsigned int i; double dash_total; - if (gstate->stroke_style.dash) - free (gstate->stroke_style.dash); + free (gstate->stroke_style.dash); gstate->stroke_style.num_dashes = num_dashes; |