From 937f2b345aa76272a1c80828e7666ab87611c0d1 Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 27 Sep 2018 11:43:02 +0200 Subject: lib: Check return values init functions This will check the return values of init functions so that the code is more robust. It also removes a duplicate init in the timerwheel, checks for buffer overflows in the RIB and checks string lengths. Signed-off-by: Sander Vrijders Signed-off-by: Dimitri Staessens --- src/lib/frct.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/frct.c') diff --git a/src/lib/frct.c b/src/lib/frct.c index c057ba50..516c958b 100644 --- a/src/lib/frct.c +++ b/src/lib/frct.c @@ -357,15 +357,15 @@ static int __frcti_rcv(struct frcti * frcti, rcv_cr->act = now.tv_sec; + pthread_rwlock_unlock(&frcti->lock); + if (!(pci->flags & FRCT_DATA)) shm_rdrbuff_remove(ai.rdrb, idx); - pthread_rwlock_unlock(&frcti->lock); - return ret; drop_packet: - shm_rdrbuff_remove(ai.rdrb, idx); pthread_rwlock_unlock(&frcti->lock); + shm_rdrbuff_remove(ai.rdrb, idx); return -EAGAIN; } -- cgit v1.2.3