setup: fix dangling pointer Issue in curl header setup (#34860)

fix dangling pointer in curl header setup
This commit is contained in:
Dean Lee
2025-03-14 01:42:22 +08:00
committed by GitHub
parent 1cd6ca467d
commit c0b6d58236
+2 -1
View File
@@ -48,7 +48,8 @@ void Setup::download(QString url) {
auto version = util::read_file("/VERSION");
struct curl_slist *list = NULL;
list = curl_slist_append(list, ("X-openpilot-serial: " + Hardware::get_serial()).c_str());
std::string header = "X-openpilot-serial: " + Hardware::get_serial();
list = curl_slist_append(list, header.c_str());
char tmpfile[] = "/tmp/installer_XXXXXX";
FILE *fp = fdopen(mkstemp(tmpfile), "wb");