HomeClusterLabs Projects

Refactor: various: improve string allocation

Description

Refactor: various: improve string allocation

Where appropriate, replace calls to malloc(), calloc(), and asprintf() with
calls to strdup(), strndup(), crm_itoa(), or crm_strdup_printf().

This improves readability, reduces the chance for programmer mistakes, and in
the case of crm_itoa() and crm_strdup_printf(), adds an assertion in case the
allocation fails.

Details

Provenance
kgaillotAuthored on Dec 20 2017, 9:07 PM
Parents
rP0ecf9a420f9f: Refactor: libcrmcommon: move crm_strdup_printf() to strings.c
Branches
Unknown
Tags
Unknown

Event Timeline