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)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 2 May 2019 04:09:19 +0000 (00:09 -0400)
commit7f63fda4c1771928d4879fa61744a22749cc3c2a
tree45d4822d59cc7980c7e561e3675579aa3256aab3
parentf7cd4a3b94d4fa4b4b00edfc4064f1ffb3079894
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.023878 seconds and 5 git commands to generate.