]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
vquic: use curl_getenv
authorDavid Zhuang <dzhuang@roblox.com>
Mon, 4 Aug 2025 23:56:15 +0000 (16:56 -0700)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 5 Aug 2025 11:12:00 +0000 (13:12 +0200)
getenv isn't defined on all platforms, which prevents vquic from
building. I specifically ran into this issue building on PlayStation.

Closes #18170

lib/vquic/vquic.c

index bebe1df6f82f0711d455b5744c638c2187d1e682..f8ce34129baf48c8d188ce5b42b9c1af8287f9a9 100644 (file)
@@ -642,7 +642,7 @@ CURLcode Curl_qlogdir(struct Curl_easy *data,
                       size_t scidlen,
                       int *qlogfdp)
 {
-  const char *qlog_dir = getenv("QLOGDIR");
+  char *qlog_dir = curl_getenv("QLOGDIR");
   *qlogfdp = -1;
   if(qlog_dir) {
     struct dynbuf fname;
@@ -667,6 +667,7 @@ CURLcode Curl_qlogdir(struct Curl_easy *data,
         *qlogfdp = qlogfd;
     }
     curlx_dyn_free(&fname);
+    free(qlog_dir);
     if(result)
       return result;
   }