The padding bytes written to the backend params file were
uninitialized. That's harmless because we don't access the padding
bytes when we read the file back in, but Valgrind doesn't know
that. In any case, clear the padding bytes to make Valgrind happy.
Reported-by: Alexander Lakhin
Discussion: https://www.postgresql.org/message-id/
014768ed-8b39-c44f-b07c-
098c87b1644c@gmail.com
BackendParameters param;
FILE *fp;
+ /*
+ * Make sure padding bytes are initialized, to prevent Valgrind from
+ * complaining about writing uninitialized bytes to the file. This isn't
+ * performance critical, and the win32 implementation initializes the
+ * padding bytes to zeros, so do it even when not using Valgrind.
+ */
+ memset(¶m, 0, sizeof(BackendParameters));
+
if (!save_backend_variables(¶m, port))
return -1; /* log made by save_backend_variables */