Hello!
Alvaro Herrera <[email protected]> writes: > 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. > > This is two commits here just for ease of review, but I'd probably push > as one commit (and without backpatch). The first commit passed without problems and works like a charm, but the second one is breaking the detection of the messages here: @@ -2392,6 +2393,8 @@ check_log_min_messages(char **newval, void **extra, GucSource source) guc_free(rawstring); return false; } + rawstring_len = strlen(rawstring); + guc_free(rawstring); The rawstring is being reference in the elemlist, so the free is making the string empty when is going to be used later: (gdb) print rawstring $17 = 0x555556f85e08 "" (gdb) print *elemlist->elements $18 = { ptr_value = 0x555556f85e08, int_value = 1459117576, oid_value = 1459117576, xid_value = 1459117576 } Regards! -- Jonathan Gonzalez V. EDB https://www.enterprisedb.com
