Skip to content

Commit

Permalink
interfaces-plugin: use SRPC_SAFE_CALL
Browse files Browse the repository at this point in the history
  • Loading branch information
zinccyy committed Nov 8, 2022
1 parent 42b7dd8 commit 53d01fd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/interfaces/src/plugin/startup/load.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 53d01fd

Please sign in to comment.