qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

block/curl: should we be checking curl_easy_setopt() for errors?


From: Peter Maydell
Subject: block/curl: should we be checking curl_easy_setopt() for errors?
Date: Mon, 30 Aug 2021 16:34:56 +0100

Coverity complains (CID 1460331, 1459482, 1459336, 1458895)
that we call curl_easy_setopt(), which can return an error value,
but we never check the return value.

Is it correct? Looking at the libcurl documentation, the function
does return an error status, and there's nothing that says it's
ok to ignore (e.g. that it's guaranteed that the library will
safely accumulate any errors and return them when you make the
subsequent curl_easy_perform() call). On the other hand, neither
the libcurl manpage example nor the handful of example programs
at https://curl.se/libcurl/c/example.html ever seem to check the
return value from curl_easy_setopt()...

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]