vquic: use curl_getenv

getenv isn't defined on all platforms, which prevents vquic from
building. I specifically ran into this issue building on PlayStation.

Closes #18170
This commit is contained in:
David Zhuang 2025-08-04 16:56:15 -07:00 committed by Daniel Stenberg
parent 4442e06b1f
commit 60587049f7
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2

View File

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