From: Laurent Vivier <laurent@vivier.eu>
To: Thomas Huth <thuth@redhat.com>, AlexChen <alex.chen@huawei.com>,
Viktor Prutyanov <viktor.prutyanov@phystech.edu>
Cc: zhengchuan@huawei.com, QEMU Trivial <qemu-trivial@nongnu.org>,
zhang.zhanghailiang@huawei.com, qemu-devel@nongnu.org,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: elf2dmp: Fix memory leak on main() error paths
Date: Fri, 11 Sep 2020 09:01:40 +0200 [thread overview]
Message-ID: <7467ade8-25c8-509c-f766-1af6bce3a729@vivier.eu> (raw)
In-Reply-To: <c9a661c3-7a86-8ae7-6304-6110d0bfb461@redhat.com>
Le 11/09/2020 à 06:18, Thomas Huth a écrit :
> On 26/08/2020 12.15, AlexChen wrote:
>> From: AlexChen <alex.chen@huawei.com>
>>
>> The 'kdgb' is allocating memory in get_kdbg(), but it is not freed
>> in both fill_header() and fill_context() failed branches, fix it.
>>
>> Signed-off-by: AlexChen <alex.chen@huawei.com>
>> ---
>> contrib/elf2dmp/main.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/contrib/elf2dmp/main.c b/contrib/elf2dmp/main.c
>> index 9a2dbc2902..ac746e49e0 100644
>> --- a/contrib/elf2dmp/main.c
>> +++ b/contrib/elf2dmp/main.c
>> @@ -568,12 +568,12 @@ int main(int argc, char *argv[])
>> if (fill_header(&header, &ps, &vs, KdDebuggerDataBlock, kdbg,
>> KdVersionBlock, qemu_elf.state_nr)) {
>> err = 1;
>> - goto out_pdb;
>> + goto out_kdbg;
>> }
>>
>> if (fill_context(kdbg, &vs, &qemu_elf)) {
>> err = 1;
>> - goto out_pdb;
>> + goto out_kdbg;
>> }
>>
>> if (write_dump(&ps, &header, argv[2])) {
>>
>
> I think this could go via qemu-trivial (now on CC:).
>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
>
>
Applied to my trivial-patches branch.
Thanks,
Laurent
prev parent reply other threads:[~2020-09-11 7:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-26 10:15 elf2dmp: Fix memory leak on main() error paths AlexChen
2020-09-04 1:04 ` AlexChen
2020-09-07 1:24 ` Li Qiang
2020-09-10 20:33 ` Viktor Prutyanov
2020-09-11 4:18 ` Thomas Huth
2020-09-11 7:01 ` Laurent Vivier [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7467ade8-25c8-509c-f766-1af6bce3a729@vivier.eu \
--to=laurent@vivier.eu \
--cc=alex.chen@huawei.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=thuth@redhat.com \
--cc=viktor.prutyanov@phystech.edu \
--cc=zhang.zhanghailiang@huawei.com \
--cc=zhengchuan@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).