Add a talloc context parameter to current_timestring() to fix memleaks.
authorMichael Adam <obnox@samba.org>
Fri, 28 Mar 2008 14:49:13 +0000 (15:49 +0100)
committerMichael Adam <obnox@samba.org>
Fri, 28 Mar 2008 15:34:51 +0000 (16:34 +0100)
commit16b5800d4e3a8b88bac67b2550d14e0aaaa302a9
tree6b0189651c6c2f54aa93f9598386bcea211f6160
parent971f6749ed23523f6eafe5136f6d4c920c20aec4
Add a talloc context parameter to current_timestring() to fix memleaks.

current_timestring used to return a string talloced to talloc_tos().
When called by DEBUG from a TALLOC_FREE, this produced messages
"no talloc stackframe around, leaking memory". For example when
used from net conf.

This also adds a temporary talloc context to alloc_sub_basic().
For this purpose, the exit strategy is slightly altered: a common
exit point is used for success and failure.

Michael
source/lib/debug.c
source/lib/substitute.c
source/lib/time.c
source/libsmb/trusts_util.c
source/rpcclient/cmd_spoolss.c
source/smbd/change_trust_pw.c
source/web/swat.c