ldpd: null check (Coverity 1452317)

Signed-off-by: F. Aragon <paco@voltanet.io>
This commit is contained in:
paco 2018-06-25 16:47:15 +02:00
parent 3a743cb7ec
commit 0ef34ac51a
No known key found for this signature in database
GPG Key ID: FD112A8C7E6A5E4A

View File

@ -89,6 +89,9 @@ struct cmd_node ldp_pseudowire_node =
int int
ldp_get_address(const char *str, int *af, union ldpd_addr *addr) ldp_get_address(const char *str, int *af, union ldpd_addr *addr)
{ {
if (!str || !af || !addr)
return (-1);
memset(addr, 0, sizeof(*addr)); memset(addr, 0, sizeof(*addr));
if (inet_pton(AF_INET, str, &addr->v4) == 1) { if (inet_pton(AF_INET, str, &addr->v4) == 1) {