diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2018-01-22 11:30:05 +0100 |
|---|---|---|
| committer | Philippe Guibert <philippe.guibert@6wind.com> | 2018-02-27 11:11:24 +0100 |
| commit | 2c7d402164cc027a62be8ed2be2ffb25b17da1bd (patch) | |
| tree | a255131e56fce65d7e9852f8924726c66eae2c2b | |
| parent | 5895d33f40fdf22f1b422154dc598bbba69e1796 (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.h | 2 |
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; } |
