summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2023-04-17 01:33:46 -0400
committerChristian Hopps <chopps@labn.net>2023-04-17 02:15:32 -0400
commite01ecbe194766ceb7d11cd993a02d629fbbf11fa (patch)
treeb625dca429d6f8f4e953c87dee7ba701c041903e
parentd249d7e0aba5bc58af2526f846d7ebcf1e817ab8 (diff)
lib: always check for error, don't count on dnode being NULL
Signed-off-by: Christian Hopps <chopps@labn.net>
-rw-r--r--lib/northbound_sysrepo.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/northbound_sysrepo.c b/lib/northbound_sysrepo.c
index 86105d2e77..7fd4af8356 100644
--- a/lib/northbound_sysrepo.c
+++ b/lib/northbound_sysrepo.c
@@ -357,7 +357,7 @@ static int frr_sr_state_data_iter_cb(const struct lysc_node *snode,
ly_errno = 0;
ly_errno = lyd_new_path(NULL, ly_native_ctx, data->xpath, data->value,
0, &dnode);
- if (!dnode && ly_errno) {
+ if (ly_errno) {
flog_warn(EC_LIB_LIBYANG, "%s: lyd_new_path() failed",
__func__);
yang_data_free(data);