cfilters: check return code from Curl_pollset_set_out_only()

I added WARN_UNUSED_RESULT to two of the cfilter functions to make this
mistake harder to slip in next time.

Pointed out by CodeSonar

Closes #19211
This commit is contained in:
Daniel Stenberg 2025-10-24 08:55:01 +02:00
parent e51966d9df
commit 576f9f7c07
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 6 additions and 4 deletions

View file

@ -542,8 +542,9 @@ CURLcode Curl_conn_connect(struct Curl_easy *data,
Curl_pollfds_reset(&cpfds);
/* In general, we want to send after connect, wait on that. */
if(sockfd != CURL_SOCKET_BAD)
Curl_pollset_set_out_only(data, &ps, sockfd);
result = Curl_conn_adjust_pollset(data, data->conn, &ps);
result = Curl_pollset_set_out_only(data, &ps, sockfd);
if(!result)
result = Curl_conn_adjust_pollset(data, data->conn, &ps);
if(result)
goto out;
result = Curl_pollfds_add_ps(&cpfds, &ps);

View file

@ -154,11 +154,12 @@ void Curl_pollset_move(struct easy_pollset *to, struct easy_pollset *from);
*/
CURLcode Curl_pollset_change(struct Curl_easy *data,
struct easy_pollset *ps, curl_socket_t sock,
int add_flags, int remove_flags);
int add_flags,
int remove_flags) WARN_UNUSED_RESULT;
CURLcode Curl_pollset_set(struct Curl_easy *data,
struct easy_pollset *ps, curl_socket_t sock,
bool do_in, bool do_out);
bool do_in, bool do_out) WARN_UNUSED_RESULT;
#define Curl_pollset_add_in(data, ps, sock) \
Curl_pollset_change((data), (ps), (sock), CURL_POLL_IN, 0)