summaryrefslogtreecommitdiff
path: root/lib/dbwrap
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-10-24 18:23:04 +1100
committerAndrew Bartlett <abartlet@samba.org>2012-10-25 22:19:59 +1100
commitf8e6bb46c005e82d5a8646e691de9282828005cc (patch)
treec70a2bb823ffd7271dd94c3b3fc98e2fd91d3b17 /lib/dbwrap
parent1008f6fbf49d5b797c7d968ea7ffdcb29d623644 (diff)
downloadsamba-f8e6bb46c005e82d5a8646e691de9282828005cc.tar.gz
samba-f8e6bb46c005e82d5a8646e691de9282828005cc.tar.bz2
samba-f8e6bb46c005e82d5a8646e691de9282828005cc.zip
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
Diffstat (limited to 'lib/dbwrap')
-rw-r--r--lib/dbwrap/dbwrap_tdb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/dbwrap/dbwrap_tdb.c b/lib/dbwrap/dbwrap_tdb.c
index 80d41b4ebb..a3a6c878a5 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)