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:23:31 +0000 (00:23 -0500)
commit664537baa0570e36f13ce63c9a2d1ead7a1e567f
tree66ec74448ca5ae41e20a759526c2f62b1f5d226b
parentc789d1bea908e474f3db1fe65160011057218ca8
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.025056 seconds and 4 git commands to generate.