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:54 +0000 (16:41 -0400)
commitbad4193f74cf859d341197a28be40f143ab178c1
treed6724e27a25b38ad140aa15fc62f01a45481e18f
parent72d536367b146c34c0b79425257a037674c69cce
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.025297 seconds and 5 git commands to generate.