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: Volker Lendecke <vl@samba.org>
void debug_unix_user_token(int dbg_class, int dbg_lev, uid_t uid, gid_t gid,
int n_groups, gid_t *groups)
{
- TALLOC_CTX *frame = talloc_stackframe();
+ TALLOC_CTX *frame = NULL;
char *s = NULL;
int i;
+ if (!CHECK_DEBUGLVLC(dbg_class, dbg_lev)) {
+ return;
+ }
+
+ frame = talloc_stackframe();
+
s = talloc_asprintf(frame,
"UNIX token of user %ld\n",
(long int)uid);