summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormmcc <mmcc@openbsd.org>2015-10-27 18:19:33 +0000
committermmcc <mmcc@openbsd.org>2015-10-27 18:19:33 +0000
commit3f056e3432d2040a3ea1004496ca1f54383b32a0 (patch)
tree7c8304d67bc62f430cf81d261b59f4f39ba2a2e2
parentadd regress test on bind(2)ing with broadcast and inexistant addresses (diff)
downloadwireguard-openbsd-3f056e3432d2040a3ea1004496ca1f54383b32a0.tar.xz
wireguard-openbsd-3f056e3432d2040a3ea1004496ca1f54383b32a0.zip
calloc -> malloc when the memory is immediately overwritten with memcpy.
ok claudio@
-rw-r--r--usr.sbin/bgpd/mrt.c4
-rw-r--r--usr.sbin/bgpd/parse.y4
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/bgpd/mrt.c b/usr.sbin/bgpd/mrt.c
index 2357caee5bc..3dbf6c12890 100644
--- a/usr.sbin/bgpd/mrt.c
+++ b/usr.sbin/bgpd/mrt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mrt.c,v 1.78 2015/08/20 22:39:29 deraadt Exp $ */
+/* $OpenBSD: mrt.c,v 1.79 2015/10/27 18:19:33 mmcc Exp $ */
/*
* Copyright (c) 2003, 2004 Claudio Jeker <claudio@openbsd.org>
@@ -990,7 +990,7 @@ mrt_mergeconfig(struct mrt_head *xconf, struct mrt_head *nconf)
LIST_FOREACH(m, nconf, entry) {
if ((xm = mrt_get(xconf, m)) == NULL) {
/* NEW */
- if ((xm = calloc(1, sizeof(struct mrt_config))) == NULL)
+ if ((xm = malloc(sizeof(struct mrt_config))) == NULL)
fatal("mrt_mergeconfig");
memcpy(xm, m, sizeof(struct mrt_config));
xm->state = MRT_STATE_OPEN;
diff --git a/usr.sbin/bgpd/parse.y b/usr.sbin/bgpd/parse.y
index a718afac34f..1c1355f34e0 100644
--- a/usr.sbin/bgpd/parse.y
+++ b/usr.sbin/bgpd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.285 2015/10/22 13:30:07 reyk Exp $ */
+/* $OpenBSD: parse.y,v 1.286 2015/10/27 18:19:33 mmcc Exp $ */
/*
* Copyright (c) 2002, 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -3509,7 +3509,7 @@ copy_filterset(struct filter_set_head *source, struct filter_set_head *dest)
return;
TAILQ_FOREACH(s, source, entry) {
- if ((t = calloc(1, sizeof(struct filter_set))) == NULL)
+ if ((t = malloc(sizeof(struct filter_set))) == NULL)
fatal(NULL);
memcpy(t, s, sizeof(struct filter_set));
TAILQ_INSERT_TAIL(dest, t, entry);