[vlc-devel] [PATCH 3/3] poll: report ENOMEM when malloc fails

Rémi Denis-Courmont remi at remlab.net
Fri Nov 27 11:54:50 CET 2015


Le 2015-11-26 19:57, Steve Lhomme a écrit :
> similar to a few lines further

This patch makes obviously no sense.

> ---
>  compat/poll.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/compat/poll.c b/compat/poll.c
> index 15e98a6..c2984cd 100644
> --- a/compat/poll.c
> +++ b/compat/poll.c
> @@ -125,7 +125,10 @@ int poll(struct pollfd *fds, unsigned nfds, int 
> timeout)
>
>      WSAEVENT *evts = malloc(nfds * sizeof (WSAEVENT));
>      if (evts == NULL)
> +    {
> +        errno = ENOMEM;
>          return -1; /* ENOMEM */
> +    }
>
>      DWORD ret = WSA_WAIT_FAILED;
>      for (unsigned i = 0; i < nfds; i++)

-- 
Rémi Denis-Courmont
http://www.remlab.net/


More information about the vlc-devel mailing list