diff options
author | Andrew Bartlett <abartlet@samba.org> | 2012-08-09 18:34:48 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2012-08-09 20:14:22 +1000 |
commit | 7e562cf3eb8d8aabf9b5d62a92e67221e4f07e3a (patch) | |
tree | bacf5c67c5ec8eed7d14663ec2ab13625e194735 | |
parent | 434bed75c43d3d7854bd9433913448810d3ff511 (diff) | |
download | samba-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
-rw-r--r-- | source4/lib/events/tevent_s4.c | 10 |
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); + } } /* |