From ab79a2e2b07818f3155e87f4653b442a07b342ee Mon Sep 17 00:00:00 2001 From: Packit Date: Sep 23 2020 13:34:31 +0000 Subject: Apply patch libproxy-0.4.11-crash.patch patch_name: libproxy-0.4.11-crash.patch present_in_specfile: true location_in_specfile: 1 --- diff --git a/libproxy/extension_pacrunner.cpp b/libproxy/extension_pacrunner.cpp index c53c4f0..d3dc787 100644 --- a/libproxy/extension_pacrunner.cpp +++ b/libproxy/extension_pacrunner.cpp @@ -22,20 +22,10 @@ using namespace libproxy; pacrunner::pacrunner(string, const url&) {} -pacrunner_extension::pacrunner_extension() { - this->pr = NULL; -} +pacrunner_extension::pacrunner_extension() {} -pacrunner_extension::~pacrunner_extension() { - if (this->pr) delete this->pr; -} +pacrunner_extension::~pacrunner_extension() {} pacrunner* pacrunner_extension::get(string pac, const url& pacurl) throw (bad_alloc) { - if (this->pr) { - if (this->last == pac) - return this->pr; - delete this->pr; - } - - return this->pr = this->create(pac, pacurl); + return this->create(pac, pacurl); } diff --git a/libproxy/proxy.cpp b/libproxy/proxy.cpp index 17e330b..d122174 100644 --- a/libproxy/proxy.cpp +++ b/libproxy/proxy.cpp @@ -416,7 +416,9 @@ void proxy_factory::run_pac(url &realurl, const url &confurl, vector &re /* Run the PAC, but only try one PACRunner */ if (debug) cerr << "Using pacrunner: " << typeid(*pacrunners[0]).name() << endl; - string pacresp = pacrunners[0]->get(this->pac, this->pacurl->to_string())->run(realurl); + pacrunner* runner = pacrunners[0]->get(this->pac, this->pacurl->to_string()); + string pacresp = runner->run(realurl); + delete runner; if (debug) cerr << "Pacrunner returned: " << pacresp << endl; format_pac_response(pacresp, response); }