From b2034e75f9fc2a3716e0c2d0f99769d36b51e831 Mon Sep 17 00:00:00 2001 From: Michal Vasko Date: Thu, 15 Aug 2024 08:25:05 +0200 Subject: [PATCH] netconf BUGFIX check return values --- src/netconf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/netconf.c b/src/netconf.c index 00ce650b..31dd5901 100644 --- a/src/netconf.c +++ b/src/netconf.c @@ -837,7 +837,9 @@ np2srv_rpc_subscribe_ntf_cb(sr_session_ctx_t *UNUSED(session), uint32_t UNUSED(s ly_ctx = sr_acquire_context(np2srv.sr_conn); sr_release_context(np2srv.sr_conn); - lyd_new_path(NULL, ly_ctx, "/nc-notifications:replayComplete", NULL, 0, &ly_ntf); + if (lyd_new_path(NULL, ly_ctx, "/nc-notifications:replayComplete", NULL, 0, &ly_ntf)) { + return; + } np_ntf_send(arg->nc_sess, timestamp, &ly_ntf, 1); /* now send all the buffered notifications */ @@ -855,7 +857,9 @@ np2srv_rpc_subscribe_ntf_cb(sr_session_ctx_t *UNUSED(session), uint32_t UNUSED(s ly_ctx = sr_acquire_context(np2srv.sr_conn); sr_release_context(np2srv.sr_conn); - lyd_new_path(NULL, ly_ctx, "/nc-notifications:notificationComplete", NULL, 0, &ly_ntf); + if (lyd_new_path(NULL, ly_ctx, "/nc-notifications:notificationComplete", NULL, 0, &ly_ntf)) { + return; + } np_ntf_send(arg->nc_sess, timestamp, &ly_ntf, 1); /* subscription finished */