summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/aliases.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/smtpd/aliases.c')
-rw-r--r--usr.sbin/smtpd/aliases.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c
index 99aa40b03af..076d7ef7099 100644
--- a/usr.sbin/smtpd/aliases.c
+++ b/usr.sbin/smtpd/aliases.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aliases.c,v 1.20 2009/10/11 17:40:49 gilles Exp $ */
+/* $OpenBSD: aliases.c,v 1.21 2009/10/12 22:34:37 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -144,6 +144,9 @@ aliases_vdomain_exists(struct smtpd *env, struct map *map, char *hostname)
DB *vtable;
char strkey[MAX_LINE_SIZE];
+ if (map == NULL)
+ return 0;
+
vtable = dbopen(map->m_config, O_RDONLY, 0600, DB_HASH, NULL);
if (vtable == NULL) {
log_warn("aliases_vdomain_exists: dbopen");
@@ -177,6 +180,9 @@ aliases_virtual_exist(struct smtpd *env, struct map *map, struct path *path)
DB *aliasesdb;
char strkey[MAX_LINE_SIZE];
+ if (map == NULL)
+ return 0;
+
aliasesdb = dbopen(map->m_config, O_RDONLY, 0600, DB_HASH, NULL);
if (aliasesdb == NULL) {
log_warn("aliases_virtual_exist: dbopen");
@@ -231,6 +237,9 @@ aliases_virtual_get(struct smtpd *env, struct map *map,
struct alias *nextalias;
char strkey[MAX_LINE_SIZE];
+ if (map == NULL)
+ return 0;
+
aliasesdb = dbopen(map->m_config, O_RDONLY, 0600, DB_HASH, NULL);
if (aliasesdb == NULL) {
log_warn("aliases_virtual_get: dbopen");