mirror of
https://github.com/curl/curl.git
synced 2026-07-27 06:37:16 +03:00
lib582: remove code causing warning that is never run
The previous realloc code in this code could trigger a compiler warning, but since that code path cannot happen in normal circumstances it now instead exits with an error message there. Ref: #12887 Closes #12890
This commit is contained in:
parent
ed09a99af5
commit
d1c9f38b8c
1 changed files with 4 additions and 10 deletions
|
|
@ -83,16 +83,10 @@ static void addFd(struct Sockets *sockets, curl_socket_t fd, const char *what)
|
|||
return;
|
||||
sockets->max_count = 20;
|
||||
}
|
||||
else if(sockets->count + 1 > sockets->max_count) {
|
||||
curl_socket_t *oldptr = sockets->sockets;
|
||||
sockets->sockets = realloc(oldptr, sizeof(curl_socket_t) *
|
||||
(sockets->max_count + 20));
|
||||
if(!sockets->sockets) {
|
||||
/* cleanup in test_cleanup */
|
||||
sockets->sockets = oldptr;
|
||||
return;
|
||||
}
|
||||
sockets->max_count += 20;
|
||||
else if(sockets->count >= sockets->max_count) {
|
||||
/* this can't happen in normal cases */
|
||||
fprintf(stderr, "too many file handles error\n");
|
||||
exit(2);
|
||||
}
|
||||
/*
|
||||
* Add file descriptor to array.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue