From: gaoxingwang <gaoxingwang1@huawei.com>
To: <stephen@networkplumber.org>
Cc: <dsahern@gmail.com>, <gaoxingwang1@huawei.com>,
<gnault@redhat.com>, <liaichun@huawei.com>,
<netdev@vger.kernel.org>, <yanan@huawei.com>
Subject: Re: [PATCH] maketable: clean up resources
Date: Thu, 20 Oct 2022 17:36:27 +0800 [thread overview]
Message-ID: <20221020093627.2621638-1-gaoxingwang1@huawei.com> (raw)
In-Reply-To: <20221017202914.64cdd5f3@hermes.local>
On Mon, 17 Oct 2022 20:29:14 -0700 [thread overview]
>On Wed, 12 Oct 2022 17:35:34 +0800
>gaoxingwang <gaoxingwang1@huawei.com> wrote:
>
>> Signed-off-by: gaoxingwang <gaoxingwang1@huawei.com>
>> ---
>> netem/maketable.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/netem/maketable.c b/netem/maketable.c
>> index ccb8f0c6..f91ce221 100644
>> --- a/netem/maketable.c
>> +++ b/netem/maketable.c
>> @@ -230,5 +230,8 @@ main(int argc, char **argv)
>> inverse = inverttable(table, TABLESIZE, DISTTABLESIZE, total);
>> interpolatetable(inverse, TABLESIZE);
>> printtable(inverse, TABLESIZE);
>> + free(table);
>> + free(inverse)
>> + close(fp);
>> return 0;
>> }
>
>Why bother. This is a tool only used during builds and this the end
>of the main program so all resources will disappear after return.
I found this issue because a white box scan of the code. Maybe fixing this will save us from the effort to explain it.
prev parent reply other threads:[~2022-10-20 9:36 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-12 9:35 [PATCH] maketable: clean up resources gaoxingwang
2022-10-18 3:29 ` Stephen Hemminger
2022-10-20 9:36 ` gaoxingwang [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=20221020093627.2621638-1-gaoxingwang1@huawei.com \
--to=gaoxingwang1@huawei.com \
--cc=dsahern@gmail.com \
--cc=gnault@redhat.com \
--cc=liaichun@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=stephen@networkplumber.org \
--cc=yanan@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