From cccc3fc1bb2794ba32b5270aa5ca0dd978d44f85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= Date: Fri, 17 May 2019 12:28:27 +0100 Subject: [PATCH] access: report an error if no access manager is present MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The code calling this method expects it to have reported an error on failure. Reviewed-by: Cole Robinson Signed-off-by: Daniel P. Berrangé --- src/access/viraccessmanager.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/access/viraccessmanager.c b/src/access/viraccessmanager.c index 31e1787919..e2ceeca57f 100644 --- a/src/access/viraccessmanager.c +++ b/src/access/viraccessmanager.c @@ -65,6 +65,12 @@ VIR_ONCE_GLOBAL_INIT(virAccessManager); virAccessManagerPtr virAccessManagerGetDefault(void) { + if (virAccessManagerDefault == NULL) { + virReportError(VIR_ERR_INTERNAL_ERROR, "%s", + _("No access manager registered")); + return NULL; + } + return virObjectRef(virAccessManagerDefault); } -- GitLab