HomeClusterLabs Projects

Fix: libcrmcommon: Don't leak memory in pcmk__cmdline_preproc.

Description

Fix: libcrmcommon: Don't leak memory in pcmk__cmdline_preproc.

Converting the intermediate pointer array into a gchar ** with realloc
results in something that we don't know how to free. Do we use free
because it was constructed with realloc, or do we use one of the g_free
functions because the contents of the array were allocated with
g_strdup?

Luckily, glib already solved this problem when they made g_strsplit (and
other functions that result in a gchar **). So, just copy what they did
there.

Details

Provenance
clumensAuthored on Jan 25 2021, 11:07 AM
Parents
rPe7058c15de5a: Fix: libcrmcommon: Free the results in various test cases.
Branches
Unknown
Tags
Unknown

Event Timeline