From dc3ddbb1377988f1335237ca68123671521f33cf Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Fri, 2 Sep 2016 08:23:27 +0200 Subject: [PATCH] ceph plugin: Ensure that at least one daemon is configured in cconn_main_loop(). This addresses a scan-build issue. --- src/ceph.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/ceph.c b/src/ceph.c index e6d3767b..ad0688cc 100644 --- a/src/ceph.c +++ b/src/ceph.c @@ -1468,6 +1468,12 @@ static int cconn_main_loop(uint32_t request_type) struct timeval end_tv; struct cconn io_array[g_num_daemons]; + if (g_num_daemons < 1) + { + ERROR ("ceph plugin: No daemons configured. See the \"Daemon\" config option."); + return ENOENT; + } + DEBUG("ceph plugin: entering cconn_main_loop(request_type = %d)", request_type); /* create cconn array */ -- 2.30.2