pygpo: Fix a talloc_tos() leak in py_gpo_get_unix_path
authorVolker Lendecke <vl@samba.org>
Fri, 17 Aug 2018 08:11:03 +0000 (10:11 +0200)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 17 Aug 2018 09:30:10 +0000 (11:30 +0200)
commit0f6b4b43711522f4770fb256f328b4b1a3893ffc
tree4a161391cd93b14f40306f5893722c47a3073a8e
parent682fafe2b3a7b196975897d6e162392d64bec4d1
pygpo: Fix a talloc_tos() leak in py_gpo_get_unix_path

cache_path() implicitly puts its result on talloc_tos(). As in
py_gpo_get_unix_path the talloc_stackframe() is only created after the
cache_path() call, we leak the result of cache_path() on
talloc_tos() (which might or might not exist).

This converts the function to the pattern used elsewhere: Create the
stackframe as the very first action and remove it as the very last
action in the function.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
libgpo/pygpo.c