X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;ds=sidebyside;f=src%2Fcommon%2Fcompat%2Fcompat-poll.c;h=4893768a098543815207c90283eb9591d97a3a4a;hb=18a720cd7bbc2eeea6d075903668e21337b5d916;hp=79fcb7d652b87230815c4d7b6d7146cf8546a9c2;hpb=cfa9a5a2b4a96e0d6a9eeddd2622a6d7c173b7ac;p=lttng-tools.git 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;