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>
This commit is contained in:
Philippe Guibert 2018-01-22 11:30:05 +01:00
parent 5895d33f40
commit 2c7d402164

View File

@ -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;
}