Re: [PATCH] perf jevents: Fix resource leak in process_mapfile()

2019-10-16 Thread Yunfeng Ye
On 2019/10/16 20:08, John Garry wrote: +    ret = -1; +    goto out; >>> >>> There's a subtle change of behaviour here, i.e. now calling >>> print_mapping_table_suffix(), but I don't think that it makes any >>> difference. >>> >> yes, I know that "goto out" will run p

Re: [PATCH] perf jevents: Fix resource leak in process_mapfile()

2019-10-16 Thread John Garry
+ret = -1; +goto out; There's a subtle change of behaviour here, i.e. now calling print_mapping_table_suffix(), but I don't think that it makes any difference. yes, I know that "goto out" will run print_mapping_table_suffix(outfp), because the error path before is don

Re: [PATCH] perf jevents: Fix resource leak in process_mapfile()

2019-10-16 Thread Yunfeng Ye
On 2019/10/16 18:40, John Garry wrote: > On 16/10/2019 08:47, Yunfeng Ye wrote: >> There are memory leaks and file descriptor resource leaks in >> process_mapfile(). >> >> Fix this by adding free() and fclose() on the error paths. >> >> Fixes: 80eeb67fe577 ("perf jevents: Program to convert JSON

Re: [PATCH] perf jevents: Fix resource leak in process_mapfile()

2019-10-16 Thread John Garry
On 16/10/2019 08:47, Yunfeng Ye wrote: There are memory leaks and file descriptor resource leaks in process_mapfile(). Fix this by adding free() and fclose() on the error paths. Fixes: 80eeb67fe577 ("perf jevents: Program to convert JSON file") Signed-off-by: Yunfeng Ye --- tools/perf/pmu-eve

Re: [PATCH] perf jevents: Fix resource leak in process_mapfile()

2019-10-16 Thread Jiri Olsa
On Wed, Oct 16, 2019 at 03:47:23PM +0800, Yunfeng Ye wrote: > There are memory leaks and file descriptor resource leaks in > process_mapfile(). > > Fix this by adding free() and fclose() on the error paths. > > Fixes: 80eeb67fe577 ("perf jevents: Program to convert JSON file") > Signed-off-by: Yu

[PATCH] perf jevents: Fix resource leak in process_mapfile()

2019-10-16 Thread Yunfeng Ye
There are memory leaks and file descriptor resource leaks in process_mapfile(). Fix this by adding free() and fclose() on the error paths. Fixes: 80eeb67fe577 ("perf jevents: Program to convert JSON file") Signed-off-by: Yunfeng Ye --- tools/perf/pmu-events/jevents.c | 9 +++-- 1 file chang