~lttng/babeltrace/trunk

Viewing all changes in revision 3653.

  • Committer: Philippe Proulx
  • Author(s): Simon Marchi
  • Date: 2019-08-25 03:06:07 UTC
  • Revision ID: git-v1:bce64edbf55818ceb0113c5824e957af7c5f39ee
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>

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: