diff options
Diffstat (limited to 'bgpd/bgp_community.c')
-rw-r--r-- | bgpd/bgp_community.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/bgpd/bgp_community.c b/bgpd/bgp_community.c index 07b8cf81..d5e9821b 100644 --- a/bgpd/bgp_community.c +++ b/bgpd/bgp_community.c @@ -206,6 +206,9 @@ community_com2str (struct community *com) u_int16_t as; u_int16_t val; + if (!com) + return NULL; + /* When communities attribute is empty. */ if (com->size == 0) { @@ -377,6 +380,9 @@ community_dup (struct community *com) char * community_str (struct community *com) { + if (!com) + return NULL; + if (! com->str) com->str = community_com2str (com); return com->str; |