bgpd: null check (Coverity 23201)

Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
paco 2018-06-13 12:45:44 +02:00
parent 9eafc8abd7
commit a247298087
No known key found for this signature in database
GPG Key ID: FD112A8C7E6A5E4A

View File

@ -642,16 +642,12 @@ struct community *community_str2com(const char *str)
community_add_val(com, val); community_add_val(com, val);
break; break;
case community_token_unknown: case community_token_unknown:
default:
if (com) if (com)
community_free(com); community_free(com);
return NULL; return NULL;
} }
} while (str); } while (str);
if (!com)
return NULL;
com_sort = community_uniq_sort(com); com_sort = community_uniq_sort(com);
community_free(com); community_free(com);