diff options
author | Mark Wielaard <mark@klomp.org> | 2022-05-09 17:32:24 +0200 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2022-05-14 15:16:45 +0200 |
commit | b814a7e45199d1c0812f3dffc23284ef66988f1e (patch) | |
tree | ab288c2bf3eb124d3144980a3714e8677c8ce2a4 /debuginfod | |
parent | f35268b20ac2172e3801851460d1a569615cdfab (diff) | |
download | elfutils-b814a7e45199d1c0812f3dffc23284ef66988f1e.tar.gz |
debuginfod: Check result of curl_easy_getinfo in debuginfod_write_callback
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>
Diffstat (limited to 'debuginfod')
-rw-r--r-- | debuginfod/ChangeLog | 5 | ||||
-rw-r--r-- | debuginfod/debuginfod-client.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog index 1c5cd4e2..8f69409b 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-05 Mark Wielaard <mark@klomp.org> * debuginfod.cxx (main): Define use_epoll. Set to MHD_USE_EPOLL 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 */ |