HomeClusterLabs Projects
Diffusion Booth 3cb0b2891d6c

attr: Fix memory leak for list and get operation

Description

attr: Fix memory leak for list and get operation

attr_get and attr_list were allocation GString but they were calling
g_string_free with second argument set to FALSE, what means GLib
was returning character data to caller (see g_string_free
for complete documentation) instead of freeing them. This return
value was ignored by attr_* functions so memory leaked.

Patch to fix this problem is simple - just set second argument of
g_string_free to TRUE so GLib takes care of freeing all data.

Signed-off-by: Jan Friesse <jfriesse@redhat.com>

Details

Provenance
jfriesseAuthored on Sep 25 2023, 12:26 PM
Parents
rB87e1602b7fd2: Merge pull request #123 from jfriesse/fix-return-code-on-do-command-failure
Branches
Unknown
Tags
Unknown

Event Timeline