s3: Fix a memory leak in check_sam_security_info3
authorVolker Lendecke <vl@samba.org>
Sat, 5 Mar 2011 11:57:59 +0000 (12:57 +0100)
committerVolker Lendecke <vlendec@samba.org>
Sat, 5 Mar 2011 13:08:37 +0000 (14:08 +0100)
commitdcbfb6fc0b9050168e2010673caccb7ec8807bd1
tree175575b07e844d04351107598c342002084e1542
parentf1a5109565cc178242acd33d9d1eb2fd80229e2c
s3: Fix a memory leak in check_sam_security_info3

Abartlet, this commit makes check_sam_security_info3 use talloc_tos() and also
cleans up the temporary talloc stackframe.

The old code created a temporary talloc context off "mem_ctx" but failed to
clean up the tmp_ctx in all but one return paths.

talloc_stackframe()/talloc_tos() is designed as a defense against exactly this
error: Even if we failed to free the frame when returning from the routine, it
would be cleaned up very soon, in our main event loop.

Please check this patch!

Thanks,

Volker

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Sat Mar  5 14:08:37 CET 2011 on sn-devel-104
source3/auth/check_samsec.c