summaryrefslogtreecommitdiff
path: root/lib/connect.c
diff options
context:
space:
mode:
authorHans-Christian Noren Egtvedt <hegtvedt@cisco.com>2020-12-09 10:42:59 +0100
committerDaniel Stenberg <daniel@haxx.se>2020-12-09 23:36:15 +0100
commit8a10abaf85c976dfce03332de5d8aaf4781d4870 (patch)
tree7e1a1576ebda21fa25b5939f50868ebf26be55bc /lib/connect.c
parent98dc9178699b102a9fc922891ce0614d261d38c5 (diff)
downloadcurl-8a10abaf85c976dfce03332de5d8aaf4781d4870.tar.gz
connect: zero variable on stack to silence valgrind complaint
Valgrind will complain that ssrem buffer usage if not explicit initialized, hence initialize it to zero. This completes the change intially started in commit 2c0d7212151 ('ftp: retry getpeername for FTP with TCP_FASTOPEN') where the ssloc buffer has a similar memset to zero. Signed-off-by: Hans-Christian Noren Egtvedt <hegtvedt@cisco.com> Closes #6289
Diffstat (limited to 'lib/connect.c')
-rw-r--r--lib/connect.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/connect.c b/lib/connect.c
index e65d24d9e..6e4608d98 100644
--- a/lib/connect.c
+++ b/lib/connect.c
@@ -680,6 +680,7 @@ void Curl_conninfo_remote(struct connectdata *conn, curl_socket_t sockfd)
struct Curl_sockaddr_storage ssrem;
curl_socklen_t plen;
plen = sizeof(struct Curl_sockaddr_storage);
+ memset(&ssrem, 0, sizeof(ssrem));
if(getpeername(sockfd, (struct sockaddr*) &ssrem, &plen)) {
int error = SOCKERRNO;
failf(conn->data, "getpeername() failed with errno %d: %s",