summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-08-17 00:46:00 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2012-08-23 14:37:21 +0200
commit93f36fb77f595f67602cd9b39bb696e802545546 (patch)
treefd9d093e2f965aa2b7c6aa16d28da7d2303157ec
parentbd67a3151aa3a3202d52fcc9ffac781b96dca04a (diff)
downloadlvm2-93f36fb77f595f67602cd9b39bb696e802545546.zip
lvm2-93f36fb77f595f67602cd9b39bb696e802545546.tar.gz
lvm2-93f36fb77f595f67602cd9b39bb696e802545546.tar.xz
cleanup: add va_end
Pair va_start with va_end.
-rw-r--r--libdaemon/server/daemon-log.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libdaemon/server/daemon-log.c b/libdaemon/server/daemon-log.c
index 8eab917..b18e70c 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 {