ctf: use create + append/insert functions when possible
Make the query code use the container value functions that create a new
empty map/array and append it to the container at the same time. It
requires less lines of code, but also makes ownership management easier:
from the start the created container is owned by the parent container.
So there is no need to track it and free it on failure.
Change-Id: Ie0e81c67f50c721ef62e159f6f1d28380078ca86 Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1995 Tested-by: jenkins <jenkins@lttng.org> Reviewed-by: Francis Deslauriers <francis.deslauriers@efficios.com>