Don't leak malloc'd strings when a GUC setting is rejected. Because guc.c prefers to keep all its string values in malloc'd not palloc'd storage, it has to be more careful than usual to avoid leaks. Error exits out of string GUC hook checks failed to clear the proposed value string, and error exits out of ProcessGUCArray() failed to clear the malloc'd results of ParseLongOption().
Found via valgrind testing. This problem is ancient, so back-patch to all supported branches. Discussion: https://postgr.es/m/[email protected] Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/642b0b69b0638261fe81dfd9ca3b92927496f1cb Modified Files -------------- src/backend/utils/misc/guc.c | 71 +++++++++++++++++++++++++++++--------------- 1 file changed, 47 insertions(+), 24 deletions(-)
