<html><head></head><body>Please keep your pointless sarcasms out of the code review.<br><br><div class="gmail_quote">Le 8 décembre 2020 17:20:37 GMT+02:00, Steve Lhomme <robux4@ycbcr.xyz> a écrit :<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre class="k9mail">On 2020-12-08 16:12, Rémi Denis-Courmont wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Callers don't expect errors here. Polling just has to work.<br><br>-1<br></blockquote><br>yes, there are plenty of return -1, as seen in the patch.<br><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Le 8 décembre 2020 16:19:13 GMT+02:00, "Hugo Beauzée-Luyssen" <br><hugo@beauzee.fr> a écrit :<hr> src/network/io.c | 7 ++++++-<br> 1 file changed, 6 insertions(+), 1 deletion(-)<br><br> diff --git a/src/network/io.c b/src/network/io.c<br> index 5285edc169..d4f15fe115 100644<br> --- a/src/network/io.c<br> +++ b/src/network/io.c<br> @@ -313,7 +313,9 @@ int net_Accept(vlc_object_t *obj, int *fds)<br> while (fds[n] != -1)<br> n++;<br> <br> - struct pollfd ufd[n];<br> + struct pollfd *ufd = malloc(n * sizeof((*ufd)));<br> + if (!ufd)<br> + return -1;<br> /* Initialize file descriptor set */<br> for (unsigned i = 0; i < n; i++)<br> {<br> @@ -328,6 +330,7 @@ int net_Accept(vlc_object_t *obj, int *fds)<br> if (net_errno != EINTR)<br> {<br> msg_Err(obj, "poll error: %s", vlc_strerror_c(net_errno));<br> + free(ufd);<br> return -1;<br> }<br> }<br> @@ -359,9 +362,11 @@ int net_Accept(vlc_object_t *obj, int *fds)<br> */<br> memmove(fds + i, fds + i + 1, n - (i + 1));<br> fds[n - 1] = sfd;<br> + free(ufd);<br> return fd;<br> }<br> }<br> + free(ufd);<br> return -1;<br> }<br> <br><br><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser <br>ma brièveté.<hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a><br><br></blockquote><hr>vlc-devel mailing list<br>To unsubscribe or modify your subscription options:<br><a href="https://mailman.videolan.org/listinfo/vlc-devel">https://mailman.videolan.org/listinfo/vlc-devel</a></pre></blockquote></div><br>-- <br>Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma brièveté.</body></html>