]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
debuginfod: Initialize response_data early in debuginfod-client query
authorMark Wielaard <mark@klomp.org>
Tue, 15 Nov 2022 16:50:01 +0000 (17:50 +0100)
committerMark Wielaard <mark@klomp.org>
Mon, 21 Nov 2022 17:20:59 +0000 (18:20 +0100)
On error going to out2, the response_data is freed. So initialize the
response_data to NULL immediately after allocation or when going back
to query_in_parallel.

Signed-off-by: Mark Wielaard <mark@klomp.org>
debuginfod/ChangeLog
debuginfod/debuginfod-client.c

index a17bc5ab7add9d77271eb365294f7262c8ff8606..a7afed94ebfdf40c0e0bcccf913189e33cd70c4c 100644 (file)
@@ -1,3 +1,8 @@
+2022-11-15  Mark Wielaard  <mark@klomp.org>
+
+       * debuginfod-client.c (debuginfod_query_server): Initialize
+       response_data early.
+
 2022-11-07  Aaron Merey  <amerey@redhat.com>
 
        * debuginfod-client.c (debuginfod_find_section): Don't treat 0 as an
index f9f26fd5880c597aa5c0f54a77f0d6fccf35dce2..8873fcc8c591225c5f0da3e4cc3805f315f46f9a 100644 (file)
@@ -1250,6 +1250,8 @@ debuginfod_query_server (debuginfod_client *c,
       data[i].handle = NULL;
       data[i].fd = -1;
       data[i].errbuf[0] = '\0';
+      data[i].response_data = NULL;
+      data[i].response_data_size = 0;
     }
 
   char *escaped_string = NULL;
@@ -1346,8 +1348,6 @@ debuginfod_query_server (debuginfod_client *c,
          curl_easy_setopt_ck (data[i].handle, CURLOPT_LOW_SPEED_LIMIT,
                               100 * 1024L);
        }
-      data[i].response_data = NULL;
-      data[i].response_data_size = 0;
       curl_easy_setopt_ck(data[i].handle, CURLOPT_FILETIME, (long) 1);
       curl_easy_setopt_ck(data[i].handle, CURLOPT_FOLLOWLOCATION, (long) 1);
       curl_easy_setopt_ck(data[i].handle, CURLOPT_FAILONERROR, (long) 1);