[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnurl] 11/254: multi: clarify condition in curl_multi_wait
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnurl] 11/254: multi: clarify condition in curl_multi_wait |
Date: |
Sat, 17 Jun 2017 16:50:43 +0200 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to annotated tag gnurl-7.54.1
in repository gnurl.
commit be299a4dba0362940062f7f07c76862ecf226522
Author: Alan Jenkins <address@hidden>
AuthorDate: Sat Apr 22 21:16:44 2017 +0100
multi: clarify condition in curl_multi_wait
`if(nfds || extra_nfds) {` is followed by `malloc(nfds * ...)`.
If `extra_fs` could be non-zero when `nfds` was zero, then we have
`malloc(0)` which is allowed to return `NULL`. But, malloc returning
NULL can be confusing. In this code, the next line would treat the NULL
as an allocation failure.
It turns out, if `nfds` is zero then `extra_nfds` must also be zero.
The final value of `nfds` includes `extra_nfds`. So the test for
`extra_nfds` is redundant. It can only confuse the reader.
Closes #1439
---
lib/multi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/multi.c b/lib/multi.c
index f16776033..26d5f1bd6 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1014,7 +1014,7 @@ CURLMcode curl_multi_wait(struct Curl_multi *multi,
curlfds = nfds; /* number of internal file descriptors */
nfds += extra_nfds; /* add the externally provided ones */
- if(nfds || extra_nfds) {
+ if(nfds) {
if(nfds > NUM_POLLS_ON_STACK) {
ufds = malloc(nfds * sizeof(struct pollfd));
if(!ufds)
--
To stop receiving notification emails like this one, please contact
address@hidden
- [GNUnet-SVN] [gnurl] 05/254: tests: remove the html and PDF versions from the tarball, (continued)
- [GNUnet-SVN] [gnurl] 05/254: tests: remove the html and PDF versions from the tarball, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 04/254: openssl: fix memory leak in servercert, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 03/254: Revert "src/Makefile.am: avoid explicit $<", gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 27/254: examples: ftpuploadfrommem.c, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 02/254: bump: start working on next release, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 28/254: url: declare get_protocol_family() static, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 62/254: transfer: fix minor buffer_size mistake, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 40/254: curl_rtmp: fix missing-variable-declarations warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 49/254: getpart: use correct variable type, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 13/254: llist: fix a comment after cbae73e1dd9, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 11/254: multi: clarify condition in curl_multi_wait,
gnunet <=
- [GNUnet-SVN] [gnurl] 08/254: llist: no longer uses malloc, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 66/254: krb5: use private buffer for temp string, not receive buffer, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 22/254: curl: set a 100K buffer size by default, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 34/254: http-proxy: removed unused argument in CURL_DISABLE_PROXY case, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 06/254: mbedtls: enable NTLM (& SMB) even if MD4 support is unavailable, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 20/254: configure: stop prepending to LDFLAGS, CPPFLAGS, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 10/254: lib: fix maybe-uninitialized warnings, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 14/254: configure: fix the -ldl check for openssl, add -lpthread check, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 17/254: nss: adapt to the new Curl_llist API, gnunet, 2017/06/17
- [GNUnet-SVN] [gnurl] 35/254: test1443: test --remote-time, gnunet, 2017/06/17