From: Jeff Law <jeffreyalaw@gmail.com>
To: Siddhesh Poyarekar <siddhesh@gotplt.org>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] testsuite: Fix leaks in tree-dynamic-object-size-0.c
Date: Mon, 5 Dec 2022 09:38:07 -0700 [thread overview]
Message-ID: <4f79f550-e1ba-1974-32ae-5a2d6e0b52f9@gmail.com> (raw)
In-Reply-To: <20221205142850.969850-1-siddhesh@gotplt.org>
On 12/5/22 07:28, Siddhesh Poyarekar wrote:
> In commit e5cfb9cac1d7aba9a8ea73bfe7922cfaff9d61f3 I introduced tests
> for strdup and strndup with leaks. Fix those leaks.
>
> gcc/testsuite/ChangeLog:
>
> * gcc.dg/builtin-dynamic-object-size-0.c (test_strdup,
> test_strndup, test_strdup_min, test_strndup_min): Free RES
> before returning from function.
We don't generally worry about these kinds of issues in the testsuite.
My only worry would be compromising the test. By adding the free calls
the compiler might match up the allocation and release and potentially
turn it into an alloca. I don't think we're likely to do that in this
case, but it's worth keeping in mind.
So OK as long as you've verified the test still does what it's supposed
to do.
jeff
next prev parent reply other threads:[~2022-12-05 16:38 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-05 14:28 Siddhesh Poyarekar
2022-12-05 16:38 ` Jeff Law [this message]
2022-12-05 16:58 ` Siddhesh Poyarekar
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=4f79f550-e1ba-1974-32ae-5a2d6e0b52f9@gmail.com \
--to=jeffreyalaw@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=siddhesh@gotplt.org \
/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 read-only IMAP folder(s) and NNTP newsgroup(s).