From e97f681ee53bda6927d8e7925a0a8c52dc4702ae Mon Sep 17 00:00:00 2001 From: Assar Westerlund Date: Sun, 10 Sep 2000 14:11:41 +0000 Subject: [PATCH] (krb5_vlog_msg): log just the format string it we fail to allocate the actual string to log, should at least provide some hint as to where things went wrong git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9029 ec53bebd-3082-4978-b11e-865c3cabbd6b --- lib/krb5/log.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/krb5/log.c b/lib/krb5/log.c index bffb4019c..110039647 100644 --- a/lib/krb5/log.c +++ b/lib/krb5/log.c @@ -356,17 +356,22 @@ krb5_vlog_msg(krb5_context context, __attribute__((format (printf, 5, 0))) { char *msg; + char *actual; char buf[64]; time_t t; int i; vasprintf(&msg, fmt, ap); + if (msg != NULL) + actual = msg; + else + actual = fmt; t = time(NULL); krb5_format_time(context, t, buf, sizeof(buf), TRUE); for(i = 0; i < fac->len; i++) if(fac->val[i].min <= level && (fac->val[i].max < 0 || fac->val[i].max >= level)) - (*fac->val[i].log)(buf, msg, fac->val[i].data); + (*fac->val[i].log)(buf, actual, fac->val[i].data); *reply = msg; return 0; }