summaryrefslogtreecommitdiff
path: root/usr.sbin/ldapd
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2014-11-16 19:04:41 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2014-11-16 19:04:41 +0000
commitbd7d610a442003b4ea0595f768150b95dad9b686 (patch)
tree2afdf4edc11099f6eca418e41107f1b985f4142f /usr.sbin/ldapd
parent2f5f7862285e78d45dc25d62be01d35ffb37f7be (diff)
Convert the logic in the error function of the ldap schema parser.
Instead of creating a temporary format string, create a temporary message. OK doug@
Diffstat (limited to 'usr.sbin/ldapd')
-rw-r--r--usr.sbin/ldapd/schema.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/usr.sbin/ldapd/schema.c b/usr.sbin/ldapd/schema.c
index d595dd13810..c5f25f70c7f 100644
--- a/usr.sbin/ldapd/schema.c
+++ b/usr.sbin/ldapd/schema.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: schema.c,v 1.15 2012/11/12 14:01:20 gsoares Exp $ */
+/* $OpenBSD: schema.c,v 1.16 2014/11/16 19:04:40 bluhm Exp $ */
/*
* Copyright (c) 2010 Martin Hedenfalk <martinh@openbsd.org>
@@ -441,15 +441,14 @@ static void
schema_err(struct schema *schema, const char *fmt, ...)
{
va_list ap;
- char *nfmt;
+ char *msg;
va_start(ap, fmt);
- if (asprintf(&nfmt, "%s:%d: %s", schema->filename, schema->lineno,
- fmt) == -1)
- fatal("asprintf");
- vlog(LOG_CRIT, nfmt, ap);
+ if (vasprintf(&msg, fmt, ap) == -1)
+ fatal("vasprintf");
va_end(ap);
- free(nfmt);
+ logit(LOG_CRIT, "%s:%d: %s", schema->filename, schema->lineno, msg);
+ free(msg);
schema->error++;
}