projects
/
lttng-tools.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix: miscellaneous memory handling fixes
[lttng-tools.git]
/
src
/
common
/
compat
/
compat-poll.c
diff --git
a/src/common/compat/compat-poll.c
b/src/common/compat/compat-poll.c
index 79fcb7d652b87230815c4d7b6d7146cf8546a9c2..4893768a098543815207c90283eb9591d97a3a4a 100644
(file)
--- 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;
}
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;
array->events = ptr;
array->alloc_size = new_size;
This page took
0.027866 seconds
and
4
git commands to generate.