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

fix dangling pointer in curl header setup
pull/34862/head
Dean Lee 1 month ago committed by GitHub
parent 1cd6ca467d
commit c0b6d58236
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 3
      selfdrive/ui/qt/setup/setup.cc

@ -48,7 +48,8 @@ void Setup::download(QString url) {
auto version = util::read_file("/VERSION"); auto version = util::read_file("/VERSION");
struct curl_slist *list = NULL; 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"; char tmpfile[] = "/tmp/installer_XXXXXX";
FILE *fp = fdopen(mkstemp(tmpfile), "wb"); FILE *fp = fdopen(mkstemp(tmpfile), "wb");

Loading…
Cancel
Save