summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri Staessens <dimitri@ouroboros.rocks>2022-02-26 12:01:58 +0100
committerSander Vrijders <sander@ouroboros.rocks>2022-03-03 12:00:54 +0100
commit5db145717d48a6ef82890a7a314af6ef89edbc8d (patch)
tree301e287fd3abaf9176e00587a6c60fc61f9caaae
parentf535637a394eecca1af182fb09b175b53e9fbf1f (diff)
downloadouroboros-5db145717d48a6ef82890a7a314af6ef89edbc8d.tar.gz
ouroboros-5db145717d48a6ef82890a7a314af6ef89edbc8d.zip
lib: Check return value of rib_init
The rib_init return value wasn't checked. Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks> Signed-off-by: Sander Vrijders <sander@ouroboros.rocks>
-rw-r--r--src/lib/dev.c7
1 files changed, 6 insertions, 1 deletions
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: