summaryrefslogtreecommitdiff
path: root/mgmtd
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2024-08-18 05:33:29 -0500
committerChristian Hopps <chopps@labn.net>2024-08-18 05:33:29 -0500
commite7fc74aa14eb29fee3af3cabefb1e5db62fa2cd5 (patch)
tree99f02fce151839888d892ec92af4ede03b062e32 /mgmtd
parentfa50fde9541348e80bb2b4835f72db86362fa38e (diff)
mgmtd: fix a couple compilation warnings.
Also an empty (thus non-replace) notify selectors message shouldn't clear the selectors, it should just do nothing. Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'mgmtd')
-rw-r--r--mgmtd/mgmt_fe_adapter.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/mgmtd/mgmt_fe_adapter.c b/mgmtd/mgmt_fe_adapter.c
index 5f53c928a4..09d1910cee 100644
--- a/mgmtd/mgmt_fe_adapter.c
+++ b/mgmtd/mgmt_fe_adapter.c
@@ -1518,7 +1518,6 @@ static void fe_adapter_handle_notify_select(struct mgmt_fe_session_ctx *session,
const char **selectors = NULL;
const char **new;
- /* An empty message clears the selectors */
if (msg_len >= sizeof(*msg)) {
selectors = mgmt_msg_native_strings_decode(msg, msg_len,
msg->selectors);
@@ -1531,7 +1530,7 @@ static void fe_adapter_handle_notify_select(struct mgmt_fe_session_ctx *session,
if (msg->replace) {
darr_free_free(session->notify_xpaths);
session->notify_xpaths = selectors;
- } else {
+ } else if (selectors) {
new = darr_append_nz(session->notify_xpaths,
darr_len(selectors));
memcpy(new, selectors, darr_len(selectors) * sizeof(*selectors));