]> git.puffer.fish Git - mirror/frr.git/commitdiff
lib: fix "use of uninitialised value" valgrind warning
authorRenato Westphal <renato@opensourcerouting.org>
Mon, 14 Jan 2019 18:29:18 +0000 (16:29 -0200)
committerRenato Westphal <renato@opensourcerouting.org>
Mon, 14 Jan 2019 18:32:23 +0000 (16:32 -0200)
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>
lib/northbound_cli.c

index 2b024ace9304f0b9753dc30f2e50ac2aa4469956..33035de31bea826f28bae2c7c1e967c70630a0ed 100644 (file)
@@ -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. */