]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
asyn-thread: fix HTTPS RR resolution
authorDexter Gerig <dexgerig@gmail.com>
Tue, 28 Jan 2025 04:45:38 +0000 (22:45 -0600)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 28 Jan 2025 08:23:33 +0000 (09:23 +0100)
Store the received data correctly.

Closes #16107

lib/asyn-thread.c

index c7e84353cbd81ac6fff599c646ab25b0e59d383d..895efbc7b577718fc51064c4bebe37701bcfdf14 100644 (file)
@@ -64,6 +64,7 @@
 #include "inet_ntop.h"
 #include "curl_threads.h"
 #include "connect.h"
+#include "strdup.h"
 
 #ifdef USE_ARES
 #include <ares.h>
@@ -619,6 +620,17 @@ CURLcode Curl_resolver_is_resolved(struct Curl_easy *data,
       destroy_async_data(&data->state.async);
       return result;
     }
+#ifdef USE_HTTPSRR_ARES
+    {
+      struct Curl_https_rrinfo *lhrr =
+        Curl_memdup(&td->hinfo, sizeof(struct Curl_https_rrinfo));
+      if(!lhrr) {
+        destroy_async_data(&data->state.async);
+        return CURLE_OUT_OF_MEMORY;
+      }
+      data->state.async.dns->hinfo = lhrr;
+    }
+#endif
     destroy_async_data(&data->state.async);
     *entry = data->state.async.dns;
   }