1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

s4-ldb_wrap: Do not vasprintf() the ldb 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

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Aug  9 13:51:06 CEST 2012 on sn-devel-104
This commit is contained in:
Andrew Bartlett 2012-08-09 19:41:05 +10:00
parent 73f0cb5278
commit 11d60d13dc

View File

@ -47,7 +47,6 @@ static void ldb_wrap_debug(void *context, enum ldb_debug_level level,
const char *fmt, va_list ap)
{
int samba_level = -1;
char *s = NULL;
switch (level) {
case LDB_DEBUG_FATAL:
samba_level = 0;
@ -63,11 +62,14 @@ static void ldb_wrap_debug(void *context, enum ldb_debug_level level,
break;
};
if (CHECK_DEBUGLVL(samba_level)) {
char *s = NULL;
vasprintf(&s, fmt, ap);
if (!s) return;
DEBUG(samba_level, ("ldb: %s\n", s));
free(s);
}
}
/*