From 942649dfb7530f116ea19f36af20b0495a9251f8 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Sat, 26 Feb 2022 14:13:51 +0100 Subject: lib: Cleanup RIB mount name IPCPs would call rib_fini() twice, once after cleaning up their managed RIB, and once again for the program-generic RIB, which is not initialized for IPCPs. rib_fini() checked if the mount name was valid, but it didn't unset it after execution. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- src/lib/rib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/rib.c b/src/lib/rib.c index 27c66f2f..2a21c2cc 100644 --- a/src/lib/rib.c +++ b/src/lib/rib.c @@ -338,7 +338,7 @@ int rib_init(const char * mountpt) fuse_opt_free_args(&args); rmdir(rib.mnt); fail_mnt: - memset(rib.mnt, 0, RIB_PATH_LEN + 1); + memset(rib.mnt, 0, sizeof(rib.mnt)); fail: return -1; #else @@ -377,6 +377,8 @@ void rib_fini(void) pthread_rwlock_unlock(&rib.lock); pthread_rwlock_destroy(&rib.lock); + + memset(rib.mnt, 0, sizeof(rib.mnt)); #endif } -- cgit v1.2.3