s3: Fix a memory leak in check_sam_security_info3
commitbcfbaf937f4e27010cdd5c7cbd378fd1f298664d
authorVolker Lendecke <vl@samba.org>
Sat, 5 Mar 2011 11:57:59 +0000 (5 12:57 +0100)
committerVolker Lendecke <vl@samba.org>
Sat, 5 Mar 2011 13:11:40 +0000 (5 14:11 +0100)
tree34a917032311034bb31a314aa2bbcd00f646d631
parent15257836ab70122823aabdb2073e96282d200eab
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
(cherry picked from commit dcbfb6fc0b9050168e2010673caccb7ec8807bd1)
source3/auth/check_samsec.c