From 53d01fda81adb4438015dd82728c2756e818d8ed Mon Sep 17 00:00:00 2001 From: Mateo Cindric Date: Tue, 8 Nov 2022 20:30:51 +0000 Subject: [PATCH] interfaces-plugin: use SRPC_SAFE_CALL --- src/interfaces/src/plugin/startup/load.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/interfaces/src/plugin/startup/load.c b/src/interfaces/src/plugin/startup/load.c index c30065f8..874d5085 100644 --- a/src/interfaces/src/plugin/startup/load.c +++ b/src/interfaces/src/plugin/startup/load.c @@ -30,12 +30,8 @@ int interfaces_startup_load(interfaces_ctx_t* ctx, sr_session_ctx_t* session) }, }; - conn_ctx = sr_session_get_connection(session); - ly_ctx = sr_acquire_context(conn_ctx); - if (ly_ctx == NULL) { - SRPLG_LOG_ERR(PLUGIN_NAME, "Unable to get ly_ctx variable"); - goto error_out; - } + SRPC_SAFE_CALL_PTR(conn_ctx, sr_session_get_connection(session), error_out); + SRPC_SAFE_CALL_PTR(ly_ctx, sr_acquire_context(conn_ctx), error_out); SRPC_SAFE_CALL_ERR(error, interfaces_ly_tree_create_interfaces(ly_ctx, &root_node), error_out);