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:36 +0000 (00:23 -0500)
commit0b2374eb38d39fa112bfac06f5140b06b33e221b
treed87e1177e3fe6e9f7ab6151f9a0e43a775ec76f5
parentc57c2c7421d2bd7611d316ac8ca1cb443e1bc95c
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.024837 seconds and 4 git commands to generate.