Reported-by: Tan Dung Le Tran <tan.dung.le.tran@ericsson.com>
Signed-off-by: David Goulet <david.goulet@polymtl.ca>
nbmem + KERNEL_EVENT_LIST_SIZE);
/* Adding the default size again */
nbmem += KERNEL_EVENT_LIST_SIZE;
- elist = realloc(elist, nbmem);
+ elist = realloc(elist, nbmem * sizeof(struct lttng_event));
if (elist == NULL) {
perror("realloc list events");
count = -ENOMEM;
DBG2("Reallocating event list from %zu to %zu bytes", nbmem,
nbmem + UST_APP_EVENT_LIST_SIZE);
nbmem += UST_APP_EVENT_LIST_SIZE;
- tmp = realloc(tmp, nbmem);
+ tmp = realloc(tmp, nbmem * sizeof(struct lttng_event));
if (tmp == NULL) {
PERROR("realloc ust app events");
ret = -ENOMEM;