HomeClusterLabs Projects

Fix: crmd: memory leaks in recurring operation history

Description

Fix: crmd: memory leaks in recurring operation history

This revision does some refactoring to (mostly) isolate access to a resource
history's recurring operations list, in order to fix two memory leaks.

First, when removing an operation from the list, the list entry could be freed
but not its data. Now, removal is functionized into history_remove_recurring_op(),
which ensures both the list entry and the data are freed, reduces code
duplication, and increases efficiency.

Second, when freeing the resource history, its recurring operations list was
not freed. Now, history freeing is functionized into history_free_recurring_ops(),
and history_cache_destroy() was moved from crmd/lrm_state.c to crmd/lrm.c,
renamed to history_free(), and now calls history_free_recurring_ops().

Details

Provenance
kgaillotAuthored on Jul 15 2015, 5:05 PM
Parents
rPf0ce1390a8c1: Feature: testing: add lrmd to CTS's default valgrind processes and allow user…
Branches
Unknown
Tags
Unknown

Event Timeline