From: Jonathan Rajotte Date: Fri, 25 Oct 2019 21:56:26 +0000 (-0400) Subject: Fix: lttng: initialize sessions pointer to NULL X-Git-Tag: v2.11.1~55 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=664537baa0570e36f13ce63c9a2d1ead7a1e567f;hp=664537baa0570e36f13ce63c9a2d1ead7a1e567f;p=lttng-tools.git 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 Signed-off-by: Jérémie Galarneau ---