mirror of
https://github.com/pi-hole/dnsmasq.git
synced 2025-12-19 18:28:25 +00:00
Grow pollfds array exponentially.
This commit is contained in:
@@ -102,8 +102,9 @@ void poll_listen(int fd, short event)
|
|||||||
{
|
{
|
||||||
/* Array too small, extend. */
|
/* Array too small, extend. */
|
||||||
struct pollfd *new;
|
struct pollfd *new;
|
||||||
arrsize += 64;
|
|
||||||
|
arrsize = (arrsize == 0) ? 64 : arrsize * 2;
|
||||||
|
|
||||||
if (!(new = whine_malloc(arrsize * sizeof(struct pollfd))))
|
if (!(new = whine_malloc(arrsize * sizeof(struct pollfd))))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user