diff options
author | Peter Eisentraut | 2022-07-16 06:42:15 +0000 |
---|---|---|
committer | Peter Eisentraut | 2022-07-16 06:50:49 +0000 |
commit | 9fd45870c1436b477264c0c82eb195df52bc0919 (patch) | |
tree | 10a09724c0bcffa8f58f262e50c3260cde484446 /src/common/ip.c | |
parent | c94ae9d827a360d74da6a304692d34a4dc8b6445 (diff) |
Replace many MemSet calls with struct initialization
This replaces all MemSet() calls with struct initialization where that
is easily and obviously possible. (For example, some cases have to
worry about padding bits, so I left those.)
(The same could be done with appropriate memset() calls, but this
patch is part of an effort to phase out MemSet(), so it doesn't touch
memset() calls.)
Reviewed-by: Ranier Vilela <ranier.vf@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@alvh.no-ip.org>
Discussion: https://www.postgresql.org/message-id/9847b13c-b785-f4e2-75c3-12ec77a3b05c@enterprisedb.com
Diffstat (limited to 'src/common/ip.c')
-rw-r--r-- | src/common/ip.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/common/ip.c b/src/common/ip.c index cd73d49679d..267103efb99 100644 --- a/src/common/ip.c +++ b/src/common/ip.c @@ -165,14 +165,12 @@ static int getaddrinfo_unix(const char *path, const struct addrinfo *hintsp, struct addrinfo **result) { - struct addrinfo hints; + struct addrinfo hints = {0}; struct addrinfo *aip; struct sockaddr_un *unp; *result = NULL; - MemSet(&hints, 0, sizeof(hints)); - if (strlen(path) >= sizeof(unp->sun_path)) return EAI_FAIL; |