Fix fp_get_pollfds()
It was increasing i too early, and writing past the allocated structures.
This commit is contained in:
parent
d816fed5c3
commit
e5da34e80a
1 changed files with 2 additions and 1 deletions
|
@ -308,9 +308,10 @@ API_EXPORTED size_t fp_get_pollfds(struct fp_pollfd **pollfds)
|
||||||
|
|
||||||
ret = g_malloc(sizeof(struct fp_pollfd) * cnt);
|
ret = g_malloc(sizeof(struct fp_pollfd) * cnt);
|
||||||
i = 0;
|
i = 0;
|
||||||
while ((usbfd = usbfds[i++]) != NULL) {
|
while ((usbfd = usbfds[i]) != NULL) {
|
||||||
ret[i].fd = usbfd->fd;
|
ret[i].fd = usbfd->fd;
|
||||||
ret[i].events = usbfd->events;
|
ret[i].events = usbfd->events;
|
||||||
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
*pollfds = ret;
|
*pollfds = ret;
|
||||||
|
|
Loading…
Reference in a new issue