HomeClusterLabs Projects

Low: libpacemaker: Fix mem leak in pcmk__profile_dir()

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Low: libpacemaker: Fix mem leak in pcmk__profile_dir()

Previously, we leaked cib_object in profile_file() if repeat > 1.

Currently the only caller is crm_simulate, and we know the scheduler
object has no relevant state at call time. Thus we can reset the
scheduler before doing the simulation.

We can avoid unnecessary copies and special case handling by setting
scheduler->input to cib_object and then setting it back to NULL before
resetting the scheduler.

Then we can make sure cib_object is freed unconditionally at the end.

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Jan 24 2025, 4:46 PM

Commit No Longer Exists

This commit no longer exists in the repository.