bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] cond expr: cleanup on errors


From: Chet Ramey
Subject: Re: [PATCH] cond expr: cleanup on errors
Date: Tue, 4 Jun 2024 09:04:33 -0400
User-agent: Mozilla Thunderbird

On 6/3/24 7:30 PM, Grisha Levit wrote:
On Mon, Jun 3, 2024 at 3:53 PM Chet Ramey <chet.ramey@case.edu> wrote:

On 5/31/24 5:07 PM, Grisha Levit wrote:
Two minor leak fixes for conditional command error conditions:

If a WORD token is read when COND_AND, COND_OR, COND_END, or a binary
operator are expected, the allocated WORD_DESC is leaked.

If a conditional command has a syntax error, the allocated COMMAND is
leaked.

Thanks for the report. These are interactive errors only, since a syntax
error in a compound command causes the shell to exit.

And also syntax errors in `eval' and `.' input when not in POSIX mode.

Sure.


But I agree this kind of fix may not be terribly useful. My goal was to
try to get LeakSanitizer results down to a more manageable level, so as
to surface interesting leaks more easily, though I'm not sure how far I
can really get.

How do you test with LeakSanitizer? Just run an interactive shell built
with it enabled?

I can certainly see the argument for not adding code (and associated
runtime overhead for the non-error path) that deals only with avoiding
leaks in cases like these. LMK if you don't think changes like this are
worthwhile.

No, keep them coming, I'll prioritize.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]