summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Guibert <philippe.guibert@6wind.com>2018-01-22 11:30:05 +0100
committerPhilippe Guibert <philippe.guibert@6wind.com>2018-02-27 11:11:24 +0100
commit2c7d402164cc027a62be8ed2be2ffb25b17da1bd (patch)
treea255131e56fce65d7e9852f8924726c66eae2c2b
parent5895d33f40fdf22f1b422154dc598bbba69e1796 (diff)
zebra: fix static analysis issue with zvrf_id
Using c-lang scan-build tool, fix a dereference of a null pointer. Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
-rw-r--r--zebra/zebra_vrf.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/zebra/zebra_vrf.h b/zebra/zebra_vrf.h
index 4d53eee093..3b9e930969 100644
--- a/zebra/zebra_vrf.h
+++ b/zebra/zebra_vrf.h
@@ -128,6 +128,8 @@ struct zebra_vrf {
static inline vrf_id_t zvrf_id(struct zebra_vrf *zvrf)
{
+ if (!zvrf || !zvrf->vrf)
+ return VRF_UNKNOWN;
return zvrf->vrf->vrf_id;
}