aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2021-07-09 13:37:04 +0300
committerGeorge Kiagiadakis <george.kiagiadakis@collabora.com>2021-07-28 13:19:02 +0300
commit8a8133fe9c4fc1628a101b5ca55375c341b1bfe9 (patch)
tree7565988b37b472082897fda28aec8e7cc1199a3a
parent404fcb1c102af07a6760a80fa994d20e9a4de7f7 (diff)
lib: initialize epoll_event structures
caught by valgrind Signed-off-by: George Kiagiadakis <george.kiagiadakis@collabora.com>
-rw-r--r--lib/receiver.c2
-rw-r--r--lib/utils.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/receiver.c b/lib/receiver.c
index 9c21063..9b34494 100644
--- a/lib/receiver.c
+++ b/lib/receiver.c
@@ -55,7 +55,7 @@ static void socket_event_received(EpollThread *t, int fd, void *data) {
socklen_t addr_size = sizeof(self->addr);
int sender_fd = accept4(fd, (struct sockaddr *)&self->addr, &addr_size,
SOCK_CLOEXEC | SOCK_NONBLOCK);
- struct epoll_event event;
+ struct epoll_event event = {0};
event.events = EPOLLIN;
event.data.fd = sender_fd;
epoll_ctl(t->epoll_fd, EPOLL_CTL_ADD, sender_fd, &event);
diff --git a/lib/utils.c b/lib/utils.c
index 37bcce9..d66bc78 100644
--- a/lib/utils.c
+++ b/lib/utils.c
@@ -199,7 +199,7 @@ bool icipc_epoll_thread_init(
icipc_epoll_thread_event_func_t sock_func,
icipc_epoll_thread_event_func_t other_func,
void *data) {
- struct epoll_event event;
+ struct epoll_event event = {0};
self->socket_fd = socket_fd;
self->event_fd = -1;