X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fcompat%2Fcompat-poll.c;h=4893768a098543815207c90283eb9591d97a3a4a;hp=79fcb7d652b87230815c4d7b6d7146cf8546a9c2;hb=53efb85a242809ed5ed21e9ab40effa696ecbc6f;hpb=8f0044bfed9f5ca51eab51478f483f92cc8f84a7 diff --git a/src/common/compat/compat-poll.c b/src/common/compat/compat-poll.c index 79fcb7d65..4893768a0 100644 --- a/src/common/compat/compat-poll.c +++ b/src/common/compat/compat-poll.c @@ -52,6 +52,11 @@ static int resize_poll_event(struct compat_poll_event_array *array, PERROR("realloc epoll add"); goto error; } + if (new_size > array->alloc_size) { + /* Zero newly allocated memory */ + memset(ptr + array->alloc_size, 0, + (new_size - array->alloc_size) * sizeof(*ptr)); + } array->events = ptr; array->alloc_size = new_size;