From 5db145717d48a6ef82890a7a314af6ef89edbc8d Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 26 Feb 2022 12:01:58 +0100 Subject: lib: Check return value of rib_init The rib_init return value wasn't checked. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/dev.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/lib/dev.c b/src/lib/dev.c index ab02a783..31941afd 100644 --- a/src/lib/dev.c +++ b/src/lib/dev.c @@ -466,11 +466,16 @@ static void init(int argc, if (strstr(argv[0], "ipcpd") == NULL) { sprintf(procstr, "proc.%d", getpid()); /* Don't bail on fail, it just won't show metrics */ - rib_init(procstr); + if (rib_init(procstr) < 0) + goto fail_rib_init; } #endif return; +#if defined PROC_FLOW_STATS + fail_rib_init: + timerwheel_fini(); +#endif fail_timerwheel: shm_flow_set_close(ai.fqset); fail_fqset: -- cgit v1.2.3