diff options
Diffstat (limited to 'source3/lib/messages_ctdb_ref.c')
-rw-r--r-- | source3/lib/messages_ctdb_ref.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/lib/messages_ctdb_ref.c b/source3/lib/messages_ctdb_ref.c index 3570ed8ae4c..47b4b758dac 100644 --- a/source3/lib/messages_ctdb_ref.c +++ b/source3/lib/messages_ctdb_ref.c @@ -52,6 +52,18 @@ void *messaging_ctdb_ref(TALLOC_CTX *mem_ctx, struct tevent_context *ev, { struct msg_ctdb_ref *result, *tmp_refs; + if (tevent_context_is_wrapper(ev)) { + /* + * This is really a programmer error! + * + * The main/raw tevent context should + * have been registered first! + */ + DBG_ERR("Should not be used with a wrapper tevent context\n"); + *err = EINVAL; + return NULL; + } + result = talloc(mem_ctx, struct msg_ctdb_ref); if (result == NULL) { *err = ENOMEM; |