Silence Valgrind complaint with EXEC_BACKEND
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
This commit is contained in:
parent
0d93ce31a5
commit
b19890d49d
@ -4490,6 +4490,14 @@ internal_forkexec(int argc, char *argv[], Port *port)
|
||||
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 */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user