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>
struct mgmt_msg_notify_data *notif_msg = msgbuf;
struct nb_node *nb_node;
struct lyd_node *dnode;
- const char *data;
+ const char *data = NULL;
const char *notif;
LY_ERR err;
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);
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));