gssproxy/Initialize-our-epoll_event-structures.patch
2020-07-31 20:18:03 +00:00

38 lines
1.2 KiB
Diff

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