Skip to content

Commit

Permalink
Low: tools: verify newly created CIB connection is not NULL
Browse files Browse the repository at this point in the history
In practice it couldn't get out of cib_new_variant() with NULLs,
but this makes static analysis happy.
  • Loading branch information
kgaillot committed Jun 11, 2020
1 parent a886051 commit 8b9dcbf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tools/crm_resource.c
Original file line number Diff line number Diff line change
Expand Up @@ -1101,6 +1101,10 @@ main(int argc, char **argv)

// Establish a connection to the CIB
cib_conn = cib_new();
if ((cib_conn == NULL) || (cib_conn->cmds == NULL)) {
CMD_ERR("Could not create CIB connection: %s", pcmk_strerror(rc));
goto bail;
}
rc = cib_conn->cmds->signon(cib_conn, crm_system_name, cib_command);
if (rc != pcmk_ok) {
CMD_ERR("Could not connect to the CIB: %s", pcmk_strerror(rc));
Expand Down

0 comments on commit 8b9dcbf

Please sign in to comment.