summaryrefslogtreecommitdiff
path: root/source4/lib/events
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-08-09 18:34:48 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-08-09 20:14:22 +1000
commit7e562cf3eb8d8aabf9b5d62a92e67221e4f07e3a (patch)
treebacf5c67c5ec8eed7d14663ec2ab13625e194735 /source4/lib/events
parent434bed75c43d3d7854bd9433913448810d3ff511 (diff)
downloadsamba-7e562cf3eb8d8aabf9b5d62a92e67221e4f07e3a.tar.gz
samba-7e562cf3eb8d8aabf9b5d62a92e67221e4f07e3a.tar.bz2
samba-7e562cf3eb8d8aabf9b5d62a92e67221e4f07e3a.zip
s4-events: Do not vasprintf() the tevent debug messages that will not be shown
This malloc() and free() actually shows up quite high on a call profile of provision of the AD DC. Andrew Bartlett
Diffstat (limited to 'source4/lib/events')
-rw-r--r--source4/lib/events/tevent_s4.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/source4/lib/events/tevent_s4.c b/source4/lib/events/tevent_s4.c
index 469ed72ee7..6770dd07af 100644
--- a/source4/lib/events/tevent_s4.c
+++ b/source4/lib/events/tevent_s4.c
@@ -46,10 +46,12 @@ static void ev_wrap_debug(void *context, enum tevent_debug_level level,
break;
};
- vasprintf(&s, fmt, ap);
- if (!s) return;
- DEBUG(samba_level, ("tevent: %s", s));
- free(s);
+ if (CHECK_DEBUGLVL(samba_level)) {
+ vasprintf(&s, fmt, ap);
+ if (!s) return;
+ DEBUG(samba_level, ("tevent: %s", s));
+ free(s);
+ }
}
/*