diff options
author | Alan Jenkins <alan.christopher.jenkins@gmail.com> | 2017-04-22 21:16:44 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2017-04-22 22:35:46 +0200 |
commit | be299a4dba0362940062f7f07c76862ecf226522 (patch) | |
tree | 334ad7fec4e9d609ff79f8553748cddbca681756 /lib/ldap.c | |
parent | 4a8cf6c4044a1692b441b64a52d1750a92b798ee (diff) |
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
Diffstat (limited to 'lib/ldap.c')
0 files changed, 0 insertions, 0 deletions