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 /perf | |
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 'perf')
-rw-r--r-- | perf/cairo-perf-report.c | 3 | ||||
-rw-r--r-- | perf/cairo-perf-trace.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/perf/cairo-perf-report.c b/perf/cairo-perf-report.c index 8ab80905..a04db6bc 100644 --- a/perf/cairo-perf-report.c +++ b/perf/cairo-perf-report.c @@ -505,8 +505,7 @@ cairo_perf_report_load (cairo_perf_report_t *report, /* Do nothing on TEST_REPORT_STATUS_COMMENT */ } - if (line) - free (line); + free (line); if (filename != NULL) fclose (file); diff --git a/perf/cairo-perf-trace.c b/perf/cairo-perf-trace.c index ff228824..587e6283 100644 --- a/perf/cairo-perf-trace.c +++ b/perf/cairo-perf-trace.c @@ -614,8 +614,7 @@ read_excludes (cairo_perf_t *perf, perf->num_exclude_names++; } } - if (line != NULL) - free (line); + free (line); fclose (file); |