From: Heikki Linnakangas Date: Fri, 13 Mar 2026 21:37:19 +0000 (+0200) Subject: Free memory allocated for unrecognized_protocol_options X-Git-Tag: REL_19_BETA1~842 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=311a851436cb39145baff61a2936c5d327b040e3;p=thirdparty%2Fpostgresql.git Free memory allocated for unrecognized_protocol_options Since 4966bd3ed95e Valgrind started to warn about little amount of memory being leaked in ProcessStartupPacket(). This is not critical but the warnings may distract from real issues. Fix it by freeing the list after use. Author: Aleksander Alekseev Discussion: https://www.postgresql.org/message-id/CAJ7c6TN3Hbb5p=UHx0SPVN+h_JwPAV6rxoqOm7gHBMFKfnGK-Q@mail.gmail.com --- diff --git a/src/backend/tcop/backend_startup.c b/src/backend/tcop/backend_startup.c index c517115927c..5abf276c898 100644 --- a/src/backend/tcop/backend_startup.c +++ b/src/backend/tcop/backend_startup.c @@ -825,6 +825,8 @@ ProcessStartupPacket(Port *port, bool ssl_done, bool gss_done) if (PG_PROTOCOL_MINOR(proto) > PG_PROTOCOL_MINOR(PG_PROTOCOL_LATEST) || unrecognized_protocol_options != NIL) SendNegotiateProtocolVersion(unrecognized_protocol_options); + + list_free_deep(unrecognized_protocol_options); } /* Check a user name was given. */