632cf8
commit bfa90160e5856cd91e7c3e58bfd50387a41b8ca9
632cf8
Author: Christine Caulfield <ccaulfie@redhat.com>
632cf8
Date:   Wed May 20 11:18:07 2020 +0100
632cf8
632cf8
    Some bugs spotted by coverity
632cf8
632cf8
diff --git a/include/tlist.h b/include/tlist.h
632cf8
index bcae55d..723d3ec 100644
632cf8
--- a/include/tlist.h
632cf8
+++ b/include/tlist.h
632cf8
@@ -191,7 +191,7 @@ static inline void timerlist_expire(struct timerlist *timerlist)
632cf8
 	uint64_t current_time;
632cf8
 
632cf8
 	current_monotonic_time = qb_util_nano_current_get();
632cf8
-	current_time_from_epoch = current_time = qb_util_nano_from_epoch_get();
632cf8
+	current_time_from_epoch = qb_util_nano_from_epoch_get();
632cf8
 
632cf8
 	qb_list_for_each_safe(pos, next, &timerlist->timer_head) {
632cf8
 
632cf8
diff --git a/lib/ringbuffer.c b/lib/ringbuffer.c
632cf8
index 3a0fb7e..cd5089a 100644
632cf8
--- a/lib/ringbuffer.c
632cf8
+++ b/lib/ringbuffer.c
632cf8
@@ -266,7 +266,7 @@ cleanup_hdr:
632cf8
 	if (fd_hdr >= 0) {
632cf8
 		close(fd_hdr);
632cf8
 	}
632cf8
-	if (rb && (flags & QB_RB_FLAG_CREATE)) {
632cf8
+	if (rb && (rb->shared_hdr != MAP_FAILED) && (flags & QB_RB_FLAG_CREATE)) {
632cf8
 		unlink(rb->shared_hdr->hdr_path);
632cf8
 		if (rb->notifier.destroy_fn) {
632cf8
 			(void)rb->notifier.destroy_fn(rb->notifier.instance);