summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/forward.c
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2009-11-09 23:54:09 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2009-11-09 23:54:09 +0000
commit9176eaf73c980dc840e80b461363bb98d81741c2 (patch)
treedc98a81860d70e0c634cf77e453a2b81ec78939e /usr.sbin/smtpd/forward.c
parenta7d426e6bd39aad9131ed6999c2af7bfd66d3e97 (diff)
now that we don't keep an expand_node in memory for each expansion result,
we don't need to calloc them as they won't be saved in the tree.
Diffstat (limited to 'usr.sbin/smtpd/forward.c')
-rw-r--r--usr.sbin/smtpd/forward.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/usr.sbin/smtpd/forward.c b/usr.sbin/smtpd/forward.c
index 84d05c87efe..f94a6921340 100644
--- a/usr.sbin/smtpd/forward.c
+++ b/usr.sbin/smtpd/forward.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: forward.c,v 1.19 2009/11/09 23:49:34 gilles Exp $ */
+/* $OpenBSD: forward.c,v 1.20 2009/11/09 23:54:08 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -43,7 +43,7 @@ forwards_get(int fd, struct expandtree *expandtree)
size_t len;
size_t nbaliases = 0;
int quoted;
- struct expand_node *expnode;
+ struct expand_node expnode;
fp = fdopen(fd, "r");
if (fp == NULL)
@@ -95,11 +95,9 @@ forwards_get(int fd, struct expandtree *expandtree)
continue;
}
- expnode = calloc(sizeof(struct expand_node), 1);
- if (expnode == NULL)
- fatal("calloc");
- alias_to_expand_node(expnode, &alias);
- expandtree_increment_node(expandtree, expnode);
+ bzero(&expnode, sizeof(struct expand_node));
+ alias_to_expand_node(&expnode, &alias);
+ expandtree_increment_node(expandtree, &expnode);
nbaliases++;
} while (*cp != '\0');
}