Fix: ustctl_release_object: eliminate double-close/free on error
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 22 Sep 2020 20:38:51 +0000 (16:38 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Tue, 22 Sep 2020 20:41:22 +0000 (16:41 -0400)
commitdd6c697c301980451ebef48313c7f679b028d878
tree6b1bbdebd9e601d2b6eae567ea17eaafb461307b
parentbf746e7d3ca3d5769c6b72a87825dd94ae7238c8
Fix: ustctl_release_object: eliminate double-close/free on error

When ustctl_release_object returns an error, it is unclear to the caller
what close/free side effects were effectively performed and which were
not. So the only courses of action are to either leak file descriptors
or memory, or call ustctl_release_object again which can trigger double
close or double free.

Fix this by setting the file descriptors to -1 after successful close,
and pointers to NULL after successful free.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
liblttng-ust-ctl/ustctl.c
This page took 0.026299 seconds and 4 git commands to generate.