Avoid resource leak (src/test/regress/pg_regress.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Avoid resource leak (src/test/regress/pg_regress.c)
Date
Msg-id CAEudQAquegvX32h5OL1Z1t8yn5wa2FAOhL5RMTqBer8ppzB4UA@mail.gmail.com
Whole thread Raw
Responses Re: Avoid resource leak (src/test/regress/pg_regress.c)
List pgsql-hackers
Hi.

Per Coverity.

The function *config_sspi_auth* is responsible for 
rewrite pg_hba.conf and pg_ident.conf to use SSPI authentication.

Coverity complains that the struct addrinfo gai_result is leaked.
The variable is declared inside block and is not used
outside the block.

So if the function WSAStartup is successful then the function getaddrinfo
allocates and fills the struct addrinfo.

The memory must be released at the end of the block.

Trivial patch attached.

best regards,
Ranier Vilela
Attachment

pgsql-hackers by date:

Previous
From: Ranier Vilela
Date:
Subject: Avoid resource leak (src/bin/pg_resetwal/pg_resetwal.c)
Next
From: Sami Imseih
Date:
Subject: Re: Bug in pg_stat_statements