talloc: add pytalloc_get_name() helper
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 9 Jul 2019 08:59:19 +0000 (08:59 +0000)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 22 Jul 2019 22:20:25 +0000 (22:20 +0000)
commit4496e073cbd0f78bcaa2cf340336e1a14bd6e8e6
tree212a4f16a2d9ef1b09175d9c50de9f8792e623e0
parent3383390b4b82e49865792b839af1e8fb798113ca
talloc: add pytalloc_get_name() helper

In several places we go

   talloc_get_name(pytalloc_get_ptr(py_obj))

which is a certain NULL derefernce if py_obj is not a talloc object.

This is a helper function that chooses to say "non-talloc object"
rather than crash.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/talloc/pytalloc.h
lib/talloc/pytalloc_util.c