From f8e6bb46c005e82d5a8646e691de9282828005cc Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 24 Oct 2012 18:23:04 +1100 Subject: [PATCH] dbwrap: use talloc_stackframe() in db_tdb_log_key() We can not be sure that there is already a talloc_stackframe() in place so we must create one. Andrew Bartlett --- lib/dbwrap/dbwrap_tdb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/dbwrap/dbwrap_tdb.c b/lib/dbwrap/dbwrap_tdb.c index 80d41b4ebb8..a3a6c878a53 100644 --- a/lib/dbwrap/dbwrap_tdb.c +++ b/lib/dbwrap/dbwrap_tdb.c @@ -42,10 +42,11 @@ static void db_tdb_log_key(const char *prefix, TDB_DATA key) { size_t len; char *keystr; - + TALLOC_CTX *frame; if (DEBUGLEVEL < 10) { return; } + frame = talloc_stackframe(); len = key.dsize; if (DEBUGLEVEL == 10) { /* @@ -53,10 +54,10 @@ static void db_tdb_log_key(const char *prefix, TDB_DATA key) */ len = MIN(10, key.dsize); } - keystr = hex_encode_talloc(talloc_tos(), (unsigned char *)(key.dptr), + keystr = hex_encode_talloc(frame, (unsigned char *)(key.dptr), len); DEBUG(10, ("%s key %s\n", prefix, keystr)); - TALLOC_FREE(keystr); + TALLOC_FREE(frame); } static int db_tdb_record_destr(struct db_record* data) -- 2.11.4.GIT