lkml.org 
[lkml]   [2019]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] perf script: Fix memory leaks in list_scripts()
From
Date


On 8/26/19 9:07 AM, Arnaldo Carvalho de Melo wrote:
> Em Sun, Aug 25, 2019 at 11:06:25PM -0500, Gustavo A. R. Silva escreveu:
>> Hi all,
>>
>> Friendly ping (second one after 4 months):
>>
>> Who can take this?
>
> Sorry for the delay, finally applied, thanks!
>

Awesome. :)

Thanks, Arnaldo.
--
Gustavo

> - Arnaldo
>
>> Thanks
>> --
>> Gustavo
>>
>> On 4/22/19 10:14 AM, Gustavo A. R. Silva wrote:
>>> Hi all,
>>>
>>> Friendly ping:
>>>
>>> Who can take this?
>>>
>>> Thanks
>>>
>>> On 4/8/19 11:27 AM, Gustavo A. R. Silva wrote:
>>>> In case memory resources for *buf* and *paths* were allocated,
>>>> jump to *out* and release them before return.
>>>>
>>>> Addresses-Coverity-ID: 1444328 ("Resource leak")
>>>> Fixes: 6f3da20e151f ("perf report: Support builtin perf script in scripts menu")
>>>> Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
>>>> ---
>>>> tools/perf/ui/browsers/scripts.c | 6 ++++--
>>>> 1 file changed, 4 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/tools/perf/ui/browsers/scripts.c b/tools/perf/ui/browsers/scripts.c
>>>> index 27cf3ab88d13..f4edb18f67ec 100644
>>>> --- a/tools/perf/ui/browsers/scripts.c
>>>> +++ b/tools/perf/ui/browsers/scripts.c
>>>> @@ -131,8 +131,10 @@ static int list_scripts(char *script_name, bool *custom,
>>>> int key = ui_browser__input_window("perf script command",
>>>> "Enter perf script command line (without perf script prefix)",
>>>> script_args, "", 0);
>>>> - if (key != K_ENTER)
>>>> - return -1;
>>>> + if (key != K_ENTER) {
>>>> + ret = -1;
>>>> + goto out;
>>>> + }
>>>> sprintf(script_name, "%s script %s", perf, script_args);
>>>> } else if (choice < num + max_std) {
>>>> strcpy(script_name, paths[choice]);
>>>>
>

\
 
 \ /
  Last update: 2019-08-26 18:01    [W:0.067 / U:2.548 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site