From fed660877c16562265327c6093ea645cf4176b5c Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 8 Jun 2005 22:10:34 +0000 Subject: r7415: * big change -- volker's new async winbindd from trunk (This used to be commit a0ac9a8ffd4af31a0ebc423b4acbb2f043d865b8) --- source3/lib/util.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index 00b08af7c39..297eeb4d030 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -2668,6 +2668,29 @@ void name_to_fqdn(fstring fqdn, const char *name) } } +/********************************************************************** + Extension to talloc_get_type: Abort on type mismatch +***********************************************************************/ + +void *talloc_check_name_abort(const void *ptr, const char *name) +{ + void *result; + + if (ptr == NULL) + return NULL; + + result = talloc_check_name(ptr, name); + if (result != NULL) + return result; + + DEBUG(0, ("Talloc type mismatch, expected %s, got %s\n", + name, talloc_get_name(ptr))); + smb_panic("aborting"); + /* Keep the compiler happy */ + return NULL; +} + + #ifdef __INSURE__ /******************************************************************* -- cgit v1.2.1