diff options
author | Sander Vrijders <sander.vrijders@ugent.be> | 2018-09-27 11:43:02 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri.staessens@ugent.be> | 2018-09-28 11:02:44 +0200 |
commit | 937f2b345aa76272a1c80828e7666ab87611c0d1 (patch) | |
tree | 7075a29558228d12b385ffaa488fe96b93e2584c /src/lib/frct.c | |
parent | 656d1ffc2abdec309cd892b54b310da30fa08095 (diff) | |
download | ouroboros-937f2b345aa76272a1c80828e7666ab87611c0d1.tar.gz ouroboros-937f2b345aa76272a1c80828e7666ab87611c0d1.zip |
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 <sander.vrijders@ugent.be>
Signed-off-by: Dimitri Staessens <dimitri.staessens@ugent.be>
Diffstat (limited to 'src/lib/frct.c')
-rw-r--r-- | src/lib/frct.c | 6 |
1 files changed, 3 insertions, 3 deletions
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; } |