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)
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>

No differences found
This page took 0.026182 seconds and 4 git commands to generate.