]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Free memory allocated for unrecognized_protocol_options
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 13 Mar 2026 21:37:19 +0000 (23:37 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 13 Mar 2026 21:37:19 +0000 (23:37 +0200)
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 <aleksander@tigerdata.com>
Discussion: https://www.postgresql.org/message-id/CAJ7c6TN3Hbb5p=UHx0SPVN+h_JwPAV6rxoqOm7gHBMFKfnGK-Q@mail.gmail.com

src/backend/tcop/backend_startup.c

index c517115927c9614696e37b6479597883b8e6eba3..5abf276c898482a25201af68924a0b3cc5b137c3 100644 (file)
@@ -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. */