When the debug level is too low to print, we don't need to allocate
the strings.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=15737
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Jennifer Sutton <jennifersutton@catalyst.net.nz>
Pair-programmed-with: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
****************************************************************************/
void security_token_debug(int dbg_class, int dbg_lev, const struct security_token *token)
{
- TALLOC_CTX *frame = talloc_stackframe();
+ TALLOC_CTX *frame = NULL;
char *sids = NULL;
char *privs = NULL;
uint32_t i;
+ if (!CHECK_DEBUGLVLC(dbg_class, dbg_lev)) {
+ return;
+ }
+
if (!token) {
DEBUGC(dbg_class, dbg_lev, ("Security token: (NULL)\n"));
- TALLOC_FREE(frame);
return;
}
+ frame = talloc_stackframe();
+
sids = talloc_asprintf(frame,
"Security token SIDs (%" PRIu32 "):\n",
token->num_sids);