public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCHv2] debuginfod: Check result of curl_easy_getinfo in debuginfod_write_callback
@ 2022-05-09 15:40 Mark Wielaard
  2022-05-14 13:20 ` Mark Wielaard
  0 siblings, 1 reply; 2+ messages in thread
From: Mark Wielaard @ 2022-05-09 15:40 UTC (permalink / raw)
  To: elfutils-devel; +Cc: Mark Wielaard

This was the only place in debuginfod-client.c where we didn't check
the result of curl_easy_getinfo. Just check it to make things consistent.

Signed-off-by: Mark Wielaard <mark@klomp.org>
---

v2 This time with the actual code change...

 debuginfod/ChangeLog           | 5 +++++
 debuginfod/debuginfod-client.c | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index 619ebd8c..91890786 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,8 @@
+2022-05-09  Mark Wielaard  <mark@klomp.org>
+
+	* debuginfod-client.c (debuginfod_write_callback): Check result
+	of curl_easy_getinfo.
+
 2022-05-04  Frank Ch. Eigler <fche@redhat.com>
 	    Mark Wielaard  <mark@klomp.org>
 
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index 521972e4..882a809a 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -213,8 +213,9 @@ debuginfod_write_callback (char *ptr, size_t size, size_t nmemb, void *data)
       *d->target_handle = d->handle;
       /* update the client object */
       const char *url = NULL;
-      (void) curl_easy_getinfo (d->handle, CURLINFO_EFFECTIVE_URL, &url);
-      if (url)
+      CURLcode curl_res = curl_easy_getinfo (d->handle,
+                                             CURLINFO_EFFECTIVE_URL, &url);
+      if (curl_res == CURLE_OK && url)
         {
           free (d->client->url);
           d->client->url = strdup(url); /* ok if fails */
-- 
2.18.4


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCHv2] debuginfod: Check result of curl_easy_getinfo in debuginfod_write_callback
  2022-05-09 15:40 [PATCHv2] debuginfod: Check result of curl_easy_getinfo in debuginfod_write_callback Mark Wielaard
@ 2022-05-14 13:20 ` Mark Wielaard
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Wielaard @ 2022-05-14 13:20 UTC (permalink / raw)
  To: elfutils-devel

Hi,

On Mon, May 09, 2022 at 05:40:39PM +0200, Mark Wielaard wrote:
> This was the only place in debuginfod-client.c where we didn't check
> the result of curl_easy_getinfo. Just check it to make things consistent.

Pushed.

Cheers,

Mark

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-05-14 13:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 15:40 [PATCHv2] debuginfod: Check result of curl_easy_getinfo in debuginfod_write_callback Mark Wielaard
2022-05-14 13:20 ` Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).