From c0b6d5823642717a7033395e002066f7be564475 Mon Sep 17 00:00:00 2001 From: Dean Lee Date: Fri, 14 Mar 2025 01:42:22 +0800 Subject: [PATCH] setup: fix dangling pointer Issue in curl header setup (#34860) fix dangling pointer in curl header setup --- selfdrive/ui/qt/setup/setup.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/selfdrive/ui/qt/setup/setup.cc b/selfdrive/ui/qt/setup/setup.cc index aff9b015b3..dfa9e12b4e 100644 --- a/selfdrive/ui/qt/setup/setup.cc +++ b/selfdrive/ui/qt/setup/setup.cc @@ -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");