if(fd >= 0 && rc < 0) {
zlog_err("unlink(babel-state): %s", safe_strerror(errno));
/* If we couldn't unlink it, it's probably stale. */
- close(fd);
- fd = -1;
+ goto fini;
}
if(fd >= 0) {
char buf[100];
zlog_err("Couldn't parse babel-state.");
}
}
- close(fd);
- fd = -1;
+ goto fini;
}
+fini:
+ if (fd >= 0)
+ close(fd);
+ return ;
}
static void
// get arguments
char *coststr = NULL, *ifaddr = NULL;
- coststr = argv_find(argv, argc, "(1-65535)", &idx) ? argv[idx]->arg
- : NULL;
- ifaddr = argv_find(argv, argc, "A.B.C.D", &idx) ? argv[idx]->arg : NULL;
-
+ argv_find(argv, argc, "(1-65535)", &idx);
+ coststr = argv[idx]->arg;
cost = strtol(coststr, NULL, 10);
+ ifaddr = argv_find(argv, argc, "A.B.C.D", &idx) ? argv[idx]->arg : NULL;
if (ifaddr) {
if (!inet_aton(ifaddr, &addr)) {
vty_out(vty,
}
if (up != NULL)
- up = hash_get(pnc->upstream_hash, up, hash_alloc_intern);
+ hash_get(pnc->upstream_hash, up, hash_alloc_intern);
if (pnc && CHECK_FLAG(pnc->flags, PIM_NEXTHOP_VALID)) {
memcpy(out_pnc, pnc, sizeof(struct pim_nexthop_cache));
prefix->u.prefix6 = addr->ipv6;
break;
default:
+ memset(prefix, 0, sizeof(*prefix));
zlog_warn("%s: unknown address family %d", __func__, af);
break;
}