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.