Fix: ctf: fix possible use-after-free in ctf_fs_component_create
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 21 Aug 2019 23:47:32 +0000 (19:47 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 4 Sep 2019 15:58:22 +0000 (11:58 -0400)
commite1cfefd2510479cb2a03c58ea843db3e17816e19
tree7e975b690513fba0c7d1196f974e642dba068aab
parent983c486ef69d4c9c83279dad92dd3f258e272181
Fix: ctf: fix possible use-after-free in ctf_fs_component_create

The error path destroys the ctf_fs_component, but doesn't reset the
variable, so we return a pointer to free'd memory.  We should be
returning NULL in the error case.  Fix it by assigning to NULL after
destroying the ctf_fs_component.

Change-Id: Ib7afd03009dc646460f77fae331920307229220a
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1973
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/ctf/fs-src/fs.c
This page took 0.025453 seconds and 4 git commands to generate.