diff options
Diffstat (limited to 'src/backend/utils/adt/network.c')
-rw-r--r-- | src/backend/utils/adt/network.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/backend/utils/adt/network.c b/src/backend/utils/adt/network.c index 429bac59e99..0985c6a459f 100644 --- a/src/backend/utils/adt/network.c +++ b/src/backend/utils/adt/network.c @@ -3,7 +3,7 @@ * is for IP V4 CIDR notation, but prepared for V6: just * add the necessary bits where the comments indicate. * - * $Header: /cvsroot/pgsql/src/backend/utils/adt/network.c,v 1.36 2002/11/10 07:25:14 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/adt/network.c,v 1.37 2002/11/11 03:02:19 momjian Exp $ * * Jon Postel RIP 16 Oct 1998 */ @@ -51,8 +51,9 @@ network_in(char *src, int type) int bits; inet *dst; + dst = (inet *) palloc(VARHDRSZ + sizeof(inet_struct)); /* make sure any unused bits in a CIDR value are zeroed */ - dst = (inet *) palloc0(VARHDRSZ + sizeof(inet_struct)); + MemSet(dst, 0, VARHDRSZ + sizeof(inet_struct)); /* First, try for an IP V4 address: */ ip_family(dst) = AF_INET; @@ -493,8 +494,9 @@ network_broadcast(PG_FUNCTION_ARGS) inet *ip = PG_GETARG_INET_P(0); inet *dst; + dst = (inet *) palloc(VARHDRSZ + sizeof(inet_struct)); /* make sure any unused bits are zeroed */ - dst = (inet *) palloc0(VARHDRSZ + sizeof(inet_struct)); + MemSet(dst, 0, VARHDRSZ + sizeof(inet_struct)); if (ip_family(ip) == AF_INET) { @@ -532,8 +534,9 @@ network_network(PG_FUNCTION_ARGS) inet *ip = PG_GETARG_INET_P(0); inet *dst; + dst = (inet *) palloc(VARHDRSZ + sizeof(inet_struct)); /* make sure any unused bits are zeroed */ - dst = (inet *) palloc0(VARHDRSZ + sizeof(inet_struct)); + MemSet(dst, 0, VARHDRSZ + sizeof(inet_struct)); if (ip_family(ip) == AF_INET) { @@ -571,8 +574,9 @@ network_netmask(PG_FUNCTION_ARGS) inet *ip = PG_GETARG_INET_P(0); inet *dst; + dst = (inet *) palloc(VARHDRSZ + sizeof(inet_struct)); /* make sure any unused bits are zeroed */ - dst = (inet *) palloc0(VARHDRSZ + sizeof(inet_struct)); + MemSet(dst, 0, VARHDRSZ + sizeof(inet_struct)); if (ip_family(ip) == AF_INET) { |