Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/netinet get zero-cleared field on malloc. kame-pr-856
details: https://anonhg.NetBSD.org/src/rev/2f506cf0ed14
branches: trunk
changeset: 573268:2f506cf0ed14
user: itojun <itojun%NetBSD.org@localhost>
date: Mon Jan 24 02:42:49 2005 +0000
description:
get zero-cleared field on malloc. kame-pr-856
diffstat:
sys/netinet/ip_encap.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (35 lines):
diff -r 550ed1eac6f7 -r 2f506cf0ed14 sys/netinet/ip_encap.c
--- a/sys/netinet/ip_encap.c Mon Jan 24 02:40:00 2005 +0000
+++ b/sys/netinet/ip_encap.c Mon Jan 24 02:42:49 2005 +0000
@@ -70,7 +70,7 @@
#define USE_RADIX
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.19 2004/08/17 07:05:34 itojun Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip_encap.c,v 1.20 2005/01/24 02:42:49 itojun Exp $");
#include "opt_mrouting.h"
#include "opt_inet.h"
@@ -594,18 +594,18 @@
}
#endif
- ep = malloc(sizeof(*ep), M_NETADDR, M_NOWAIT); /* M_NETADDR ok? */
+ /* M_NETADDR ok? */
+ ep = malloc(sizeof(*ep), M_NETADDR, M_NOWAIT|M_ZERO);
if (ep == NULL) {
error = ENOBUFS;
goto fail;
}
- bzero(ep, sizeof(*ep));
- ep->addrpack = malloc(l, M_NETADDR, M_NOWAIT);
+ ep->addrpack = malloc(l, M_NETADDR, M_NOWAIT|M_ZERO);
if (ep->addrpack == NULL) {
error = ENOBUFS;
goto gc;
}
- ep->maskpack = malloc(l, M_NETADDR, M_NOWAIT);
+ ep->maskpack = malloc(l, M_NETADDR, M_NOWAIT|M_ZERO);
if (ep->maskpack == NULL) {
error = ENOBUFS;
goto gc;
Home |
Main Index |
Thread Index |
Old Index