diff options
-rw-r--r-- | libdaemon/server/daemon-log.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/libdaemon/server/daemon-log.c b/libdaemon/server/daemon-log.c index 8eab917c..b18e70cf 100644 --- a/libdaemon/server/daemon-log.c +++ b/libdaemon/server/daemon-log.c @@ -53,13 +53,15 @@ void daemon_log(log_state *s, int type, const char *message) { } void daemon_logf(log_state *s, int type, const char *fmt, ...) { + char *buf; va_list ap; + va_start(ap, fmt); - char *buf; - if (dm_vasprintf(&buf, fmt, ap) < 0) - return; /* _0 */ - daemon_log(s, type, buf); - dm_free(buf); + if (dm_vasprintf(&buf, fmt, ap) >= 0) { + daemon_log(s, type, buf); + dm_free(buf); + } /* else return_0 */ + va_end(ap); } struct log_line_baton { |