avoid-resource-leak-pg_regress.patch

application/octet-stream

Filename: avoid-resource-leak-pg_regress.patch
Type: application/octet-stream
Part: 0
Message: Avoid resource leak (src/test/regress/pg_regress.c)

Patch

Same data as JSON: GET /api/v1/attachments/:id/patch the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes. API reference →
Format: unified
File+
src/test/regress/pg_regress.c 4 1
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index efc41fca2b..c0a747373d 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -1038,7 +1038,7 @@ config_sspi_auth(const char *pgdata, const char *superuser_name)
 	 * ::1 (IPv6 loopback) as a numeric host address string.
 	 */
 	{
-		struct addrinfo *gai_result;
+		struct addrinfo *gai_result = NULL;
 		struct addrinfo hints;
 		WSADATA		wsaData;
 
@@ -1053,6 +1053,9 @@ config_sspi_auth(const char *pgdata, const char *superuser_name)
 
 		have_ipv6 = (WSAStartup(MAKEWORD(2, 2), &wsaData) == 0 &&
 					 getaddrinfo("::1", NULL, &hints, &gai_result) == 0);
+
+		if (gai_result)
+			freeaddrinfo(gai_result);
 	}
 
 	/* Check a Write outcome and report any error. */