summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRenato Westphal <renato@opensourcerouting.org>2019-01-14 19:29:18 +0100
committerRenato Westphal <renato@opensourcerouting.org>2019-01-14 19:30:39 +0100
commitec348d4344da548a3b7b22f644953e5fa275c1df (patch)
tree5be2a760f54d1326fc43f33ee5b81d4cfbce1d6a /lib
parentMerge pull request #3529 from donaldsharp/some_integration (diff)
downloadfrr-ec348d4344da548a3b7b22f644953e5fa275c1df.tar.xz
frr-ec348d4344da548a3b7b22f644953e5fa275c1df.zip
lib: fix "may be used uninitialized" build warning
We are already handling all possible four cases from the "nb_event" enumeration, so this problem can't happen in practice. Initialize the "ref" variable to zero to silence the warning. Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/northbound.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/northbound.c b/lib/northbound.c
index a7f9c8620..70d11a4a4 100644
--- a/lib/northbound.c
+++ b/lib/northbound.c
@@ -719,7 +719,6 @@ static int nb_configuration_callback(const enum nb_event event,
const struct lyd_node *dnode = change->cb.dnode;
union nb_resource *resource;
int ret = NB_ERR;
- enum lib_log_refs ref;
if (debug_northbound) {
const char *value = "(none)";
@@ -753,6 +752,8 @@ static int nb_configuration_callback(const enum nb_event event,
}
if (ret != NB_OK) {
+ enum lib_log_refs ref = 0;
+
switch (event) {
case NB_EV_VALIDATE:
ref = EC_LIB_NB_CB_CONFIG_VALIDATE;