|
|
9af0d9 |
From c824b8ef3b5ec630edb0f8be78b64b2431c4482f Mon Sep 17 00:00:00 2001
|
|
|
9af0d9 |
From: Robbie Harwood <rharwood@redhat.com>
|
|
|
9af0d9 |
Date: Thu, 30 Jul 2020 16:43:30 -0400
|
|
|
9af0d9 |
Subject: [PATCH] Initialize our epoll_event structures
|
|
|
9af0d9 |
|
|
|
9af0d9 |
Fixes a valgrind error for the other fields of epoll_event.
|
|
|
9af0d9 |
|
|
|
9af0d9 |
Signed-off-by: Robbie Harwood <rharwood@redhat.com>
|
|
|
9af0d9 |
(cherry picked from commit 48bfadc538bca3b9ca478c711af75245163d0b67)
|
|
|
9af0d9 |
(cherry picked from commit 35579d9de1d3f295fb4548c73fc6a729d04128c6)
|
|
|
9af0d9 |
---
|
|
|
9af0d9 |
src/client/gpm_common.c | 6 ++++++
|
|
|
9af0d9 |
1 file changed, 6 insertions(+)
|
|
|
9af0d9 |
|
|
|
9af0d9 |
diff --git a/src/client/gpm_common.c b/src/client/gpm_common.c
|
|
|
9af0d9 |
index 808f350..d932ba2 100644
|
|
|
9af0d9 |
--- a/src/client/gpm_common.c
|
|
|
9af0d9 |
+++ b/src/client/gpm_common.c
|
|
|
9af0d9 |
@@ -195,6 +195,8 @@ static int gpm_epoll_setup(struct gpm_ctx *gpmctx)
|
|
|
9af0d9 |
struct epoll_event ev;
|
|
|
9af0d9 |
int ret;
|
|
|
9af0d9 |
|
|
|
9af0d9 |
+ memset(&ev, 0, sizeof(ev));
|
|
|
9af0d9 |
+
|
|
|
9af0d9 |
if (gpmctx->epollfd >= 0) {
|
|
|
9af0d9 |
gpm_epoll_close(gpmctx);
|
|
|
9af0d9 |
}
|
|
|
9af0d9 |
@@ -276,6 +278,10 @@ static int gpm_epoll_wait(struct gpm_ctx *gpmctx, uint32_t event_flags)
|
|
|
9af0d9 |
struct epoll_event events[2];
|
|
|
9af0d9 |
uint64_t timer_read;
|
|
|
9af0d9 |
|
|
|
9af0d9 |
+ memset(&ev, 0, sizeof(ev));
|
|
|
9af0d9 |
+ memset(&events[0], 0, sizeof(events[0]));
|
|
|
9af0d9 |
+ memset(&events[1], 0, sizeof(events[1]));
|
|
|
9af0d9 |
+
|
|
|
9af0d9 |
if (gpmctx->epollfd < 0) {
|
|
|
9af0d9 |
ret = gpm_epoll_setup(gpmctx);
|
|
|
9af0d9 |
if (ret)
|