summaryrefslogtreecommitdiff
path: root/lib/northbound_cli.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-01-14 16:29:18 -0200
committerRenato Westphal <renato@opensourcerouting.org>2019-01-14 16:32:23 -0200
commitf65fb6b4b4530b6f4aa7408a4e256017ccb0f2c2 (patch)
tree4d946728d6a8409857b5d1177cfe52e64ce7874e /lib/northbound_cli.c
parentec348d4344da548a3b7b22f644953e5fa275c1df (diff)
lib: fix "use of uninitialised value" valgrind warning
When FRR is built without the --enable-config-rollbacks option, the nb_db_transaction_save() function does nothing and the "transaction_id" output parameter is left uninitialized. For this reason, all northbound clients should initialize the "transaction_id" argument before calling nb_candidate_commit() or nb_candidate_commit_apply() (except when a NULL pointer is given, which is the case of the confd and sysrepo plugins). Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib/northbound_cli.c')
-rw-r--r--lib/northbound_cli.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c
index 2b024ace93..33035de31b 100644
--- a/lib/northbound_cli.c
+++ b/lib/northbound_cli.c
@@ -261,7 +261,7 @@ static int nb_cli_confirmed_commit_timeout(struct thread *thread)
static int nb_cli_commit(struct vty *vty, bool force,
unsigned int confirmed_timeout, char *comment)
{
- uint32_t transaction_id;
+ uint32_t transaction_id = 0;
int ret;
/* Check if there's a pending confirmed commit. */