[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: fix memory leaks and enable ASAN/UBSAN
From: |
Jim Meyering |
Subject: |
Re: fix memory leaks and enable ASAN/UBSAN |
Date: |
Tue, 7 Aug 2018 10:59:06 +0200 |
On Tue, Aug 7, 2018 at 12:13 AM, Assaf Gordon <address@hidden> wrote:
> Hello,
>
> Thanks for the review.
>
> On 06/08/18 02:04 AM, Jim Meyering wrote:
>>
>> On Sun, Aug 5, 2018 at 7:12 AM, Assaf Gordon <address@hidden>
>> wrote:
>>>>
>>>>
>>>> Attached few patches that fix memory leaks.
>>>> Most are not critical, and only enabled with DEBUG_LEAKS.
>>>> But one does need review, I suspect it is a runtime leak.
>>>>
>>
>> Did you consider using the "lint" cpp symbol, along with its IF_LINT
>> for single-line suppressions? That is what coreutils does. Spurious
>> leaks are just another type of "lint" after all.
>
>
> Good point.
> "DEBUG_LEAKS" was introduced in 1999 (based on the ChangeLog).
> The attached patch replaces all instances of DEBUG_LEAKS with lint.
>
>> Re your question in "sed: fix memory leak", I agree: that is indeed a
>> real leak, and worth fixing unconditionally. Good catch.
>
>
> Thanks for looking into that.
> The updated patch makes it unconditional.
Thanks. Only two nits, now, and the first probably isn't worth addressing.
maint: add address-sanitizer build target
- adds empty line at end of cfg.mk, so an intermediate syntax-check
would fail. A later patch appends another block with no trailing blank
line, so in the end it's ok.
sed: free allocated memory under lint, remove DEBUG_LEAKS
- log message typo: remove the "h" in "For consistenchy"