HomeClusterLabs Projects

Fix: libcrmcommon: assert if can't generate operation key

Description

Fix: libcrmcommon: assert if can't generate operation key

This is a refactor of generate_op_key() to use the existing
crm_strdup_printf() function instead of its own allocation,
and use CRM_ASSERT() instead of CRM_CHECK() for argument validation.

This simplifies the code, avoids allocating more memory than needed,
and results in assertion failures instead of returning NULL on errors,
which is preferable because existing callers don't check the
return value for NULL before using it.

Details

Provenance
kgaillotAuthored on Feb 27 2017, 3:10 PM
Parents
rPb220136266f5: Merge pull request #1232 from haySwim/master
Branches
Unknown
Tags
Unknown

Event Timeline