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