Fix: lttng: initialize sessions pointer to NULL
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 25 Oct 2019 21:56:26 +0000 (17:56 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 5 Nov 2019 05:21:28 +0000 (00:21 -0500)
commitaff0fa7248c73edb8e02578c83e338716cf695ec
tree628ea47d3e9bde1c56dd435854522f1ea05d8474
parent20dd2de1fa1efe1519d1b6e88386efa89d60d1b9
Fix: lttng: initialize sessions pointer to NULL

lttng_list_sessions does not set the passed pointer to NULL on empty
return. This leads to a deallocation of an invalid pointer (segfault).

For returns of size 0, the value of the passed argument should be
considered "undefined".

Refactor error handling a bit by removing the "error" jump. Always
call free on the 'sessions' object.

Fixes #1205

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/list.c
This page took 0.030973 seconds and 4 git commands to generate.