lkml.org 
[lkml]   [2016]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [tip:perf/core] perf tools: Fix locale handling in pmu parsing

* tip-bot for Jiri Olsa <tipbot@zytor.com> wrote:

> @@ -135,6 +146,8 @@ static int perf_pmu__parse_scale(struct perf_pmu_alias *alias, char *dir, char *
> /* restore locale */
> setlocale(LC_NUMERIC, lc);
>
> + free((char *) lc);
> +

Btw., minor side note: why does 'lc' have to be case to 'char *'?

In the kernel kfree() takes 'const void *':

include/linux/slab.h:void kfree(const void *);

which will accept all pointer types. That avoids unnecessary and fragile type
casts.

Thanks,

Ingo

\
 
 \ /
  Last update: 2016-03-08 15:01    [W:0.075 / U:1.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site