Fix: cli: Acquire reference on bt_value_null while parsing args
authorSimon Marchi <simon.marchi@efficios.com>
Thu, 18 Apr 2019 18:00:29 +0000 (14:00 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 3 May 2019 22:19:39 +0000 (18:19 -0400)
commit130417948312e8aa9ab10b077953d40c9a56101b
tree99069ba9683075362716ca356f9accfd793f57ef
parent3b841d03f1c9d9cf3418595d8cd334df63f78d4f
Fix: cli: Acquire reference on bt_value_null while parsing args

In bt_config_query_from_args, we initialize "params" to point to
bt_value_null without acquiring a reference:

    bt_value *params = bt_value_null;

When handling OPT_PARAMS, lower, we call "put" on it before assigning
params to something else:

    bt_value_put_ref(params);

This causes bt_value_null's refcount to drop to 0 and its release to be
called (which should never happen, since its refcount is initialized to
1).  This warning is shown:

    $ ./cli/babeltrace query
    ...
    04-18 13:56:12.267 10081 10081 W VALUES bt_value_null_instance_release_func@value.c:73 Releasing the null value singleton: addr=0x7f882eaf1b60

Fix it by acquiring a new reference in the beginning.

Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
cli/babeltrace-cfg-cli-args.c
This page took 0.024478 seconds and 4 git commands to generate.