From: Jérémie Galarneau Date: Sat, 27 May 2017 19:26:54 +0000 (-0400) Subject: Fix: uninitialized destination component on unknown args X-Git-Tag: v2.0.0-pre1~146 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=0a011c88380de31f0b94f6c0190c5595dec3d1b0 Fix: uninitialized destination component on unknown args Signed-off-by: Jérémie Galarneau --- diff --git a/cli/babeltrace-cfg-cli-args.c b/cli/babeltrace-cfg-cli-args.c index 64f196e5..195c891c 100644 --- a/cli/babeltrace-cfg-cli-args.c +++ b/cli/babeltrace-cfg-cli-args.c @@ -1309,6 +1309,7 @@ enum { }; enum bt_config_component_dest { + BT_CONFIG_COMPONENT_DEST_UNKNOWN = -1, BT_CONFIG_COMPONENT_DEST_SOURCE, BT_CONFIG_COMPONENT_DEST_FILTER, BT_CONFIG_COMPONENT_DEST_SINK, @@ -2413,7 +2414,8 @@ struct bt_config *bt_config_run_from_args(int argc, const char *argv[], poptContext pc = NULL; char *arg = NULL; struct bt_config_component *cur_cfg_comp = NULL; - enum bt_config_component_dest cur_cfg_comp_dest; + enum bt_config_component_dest cur_cfg_comp_dest = + BT_CONFIG_COMPONENT_DEST_UNKNOWN; struct bt_value *cur_base_params = NULL; int opt, ret = 0; struct bt_config *cfg = NULL; @@ -3567,7 +3569,8 @@ struct bt_config *bt_config_convert_from_args(int argc, const char *argv[], { poptContext pc = NULL; char *arg = NULL; - enum bt_config_component_dest cur_comp_dest; + enum bt_config_component_dest cur_comp_dest = + BT_CONFIG_COMPONENT_DEST_UNKNOWN; int opt, ret = 0; struct bt_config *cfg = NULL; bool got_verbose_opt = false;