mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 07:31:41 +00:00
perf tools: No need to test against NULL before calling free()
Its perfectly fine to call free(NULL), so no need to clutter the source code with all those superfluous testing. Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: David Ahern <dsahern@gmail.com> Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Mike Galbraith <efault@gmx.de> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Paul Mackerras <paulus@samba.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Stephane Eranian <eranian@google.com> Link: http://lkml.kernel.org/n/tip-uux5wpvevlerd42gqer13e7n@git.kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
This commit is contained in:
parent
6dd601354f
commit
f5385650c0
7 changed files with 31 additions and 62 deletions
|
@ -161,8 +161,7 @@ static void define_event_symbols(struct event_format *event,
|
|||
zero_flag_atom = 0;
|
||||
break;
|
||||
case PRINT_FIELD:
|
||||
if (cur_field_name)
|
||||
free(cur_field_name);
|
||||
free(cur_field_name);
|
||||
cur_field_name = strdup(args->field.name);
|
||||
break;
|
||||
case PRINT_FLAGS:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue