On Mon, Jul 20, 2026 at 9:15 PM Alvaro Herrera <[email protected]> wrote:
>
> Hello,
>
> Here's a couple of trivial cleanups of this code.  0001 simplifies code
> and removes a duplicate by creating a small subroutine; 0002 also
> simplifies memory freeing a tad, by freeing allocations as soon as
> no longer needed instead of waiting and being forced to duplicate the
> frees in several places.

+ rawstring_len = strlen(rawstring);
+ guc_free(rawstring);

SplitGUCList() stores pointers into rawstring in elemlist, so
after guc_free(rawstring), the subsequent foreach over elemlist,etc
still seem to dereference freed memory. So rawstring should remain
alive until we're done using all the elements of elemlist?

BTW, with the patches, I saw the following initdb failure:

    running bootstrap script ... LOG:  invalid value for parameter
"log_min_messages": "warning"
    DETAIL:  Unrecognized log level: "".
    FATAL:  failed to initialize log_min_messages to "warning"
    child process exited with exit code 1
    initdb: removing data directory "data"

Regards,

-- 
Fujii Masao


Reply via email to