diff --git a/src/bin/pg_basebackup/pg_recvlogical.c b/src/bin/pg_basebackup/pg_recvlogical.c
index a631cee2dd7aa215889357a7ad09408a9a120691..7b27aab5909122b75c71b8e10ec7dd2c69c6442c 100644
--- a/src/bin/pg_basebackup/pg_recvlogical.c
+++ b/src/bin/pg_basebackup/pg_recvlogical.c
@@ -316,7 +316,7 @@ StreamLog(void)
 			int64		message_target = 0;
 			int64		fsync_target = 0;
 			struct timeval timeout;
-			struct timeval *timeoutptr;
+			struct timeval *timeoutptr = NULL;
 
 			FD_ZERO(&input_mask);
 			FD_SET(PQsocket(conn), &input_mask);