summaryrefslogtreecommitdiff
path: root/pimd/pim_static.c
diff options
context:
space:
mode:
authorRenato Westphal <renato@openbsd.org>2018-07-09 16:02:47 -0300
committerGitHub <noreply@github.com>2018-07-09 16:02:47 -0300
commitfbde7f293e6e9e6b5adf0423c494e04600b423d5 (patch)
treec70c1965875dc07868a6b5bec0a3286249b08759 /pimd/pim_static.c
parentb4d3968a6835422a80129d828bde95715d9d74de (diff)
parent2b57b9483420059dc7a826abe33b626a66bb5dfe (diff)
Merge pull request #2637 from donaldsharp/pim_malloc_me
pimd: Remove unnecessary alloc failures
Diffstat (limited to 'pimd/pim_static.c')
-rw-r--r--pimd/pim_static.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/pimd/pim_static.c b/pimd/pim_static.c
index 3d44a01c78..9569b7dcac 100644
--- a/pimd/pim_static.c
+++ b/pimd/pim_static.c
@@ -39,14 +39,7 @@ void pim_static_route_free(struct static_route *s_route)
static struct static_route *static_route_alloc()
{
- struct static_route *s_route;
-
- s_route = XCALLOC(MTYPE_PIM_STATIC_ROUTE, sizeof(*s_route));
- if (!s_route) {
- zlog_err("PIM XCALLOC(%zu) failure", sizeof(*s_route));
- return 0;
- }
- return s_route;
+ return XCALLOC(MTYPE_PIM_STATIC_ROUTE, sizeof(struct static_route));
}
static struct static_route *static_route_new(unsigned int iif, unsigned int oif,
@@ -55,9 +48,6 @@ static struct static_route *static_route_new(unsigned int iif, unsigned int oif,
{
struct static_route *s_route;
s_route = static_route_alloc();
- if (!s_route) {
- return 0;
- }
s_route->group = group;
s_route->source = source;