rbowman wrote this screed in ALL-CAPS (fixed):
> On Mon, 2 Nov 2026 14:18:27 -0500, Chris Ahlstrom wrote:
>
>> It found a few issues in a couple of my projects, a few issues
>> important.
>> There is one that I don't get
>>
>> subprojects/libcfg66/src/util/filefunctions.cpp:1138:33: warning:
>> Memory allocated by 'new[]' should be deallocated by 'delete[]',
>> not 'getline()' [unix.MismatchedDeallocator]
>>
>> 1138 | ssize_t count { getline(&destination, &maxim, input) };
>> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>
>> I guess I need to use malloc() instead.
>
> Did you allocate destination with new? getline will malloc a buffer if you
> pass in NULL.
Yes, and I know that from the man page.
The point is scan-build complaining about something getline() will
not do in the given use case.
A limitation of static analysis, perhaps.
--
<Stealth> How do I bind a computer to an NIS server?
<Joey> Use a rope?
-- Seen on #Debian