summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominique Leuenberger <dimstar@opensuse.org>2020-11-10 15:43:25 +0100
committerGitHub <noreply@github.com>2020-11-10 15:43:25 +0100
commited7726bbda072bf89cb08fde01a5e30eb1be09cb (patch)
treeeeb429573e14ff0f6c9d05ba48c5877239206bd5
parentcd619d3e9d683237f6317f979d5c6a7290d7e429 (diff)
parent83cee994952ceb2ff4c818de78f7758c75549e3d (diff)
downloadlibproxy-git-ed7726bbda072bf89cb08fde01a5e30eb1be09cb.tar.gz
Merge pull request #137 from mcatanzaro/mcatanzaro/mismatched-delete
Fix mismatched new[]/delete[] in proxy.cpp
-rw-r--r--libproxy/proxy.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libproxy/proxy.cpp b/libproxy/proxy.cpp
index 2d01d53..72d0039 100644
--- a/libproxy/proxy.cpp
+++ b/libproxy/proxy.cpp
@@ -244,7 +244,7 @@ void proxy_factory::check_network_topology() {
vector<wpad_extension*> wpads = this->mm.get_extensions<wpad_extension>();
for (vector<wpad_extension*>::iterator j=wpads.begin() ; j != wpads.end() ; j++)
(*j)->rewind();
- if (this->pac) delete this->pac;
+ if (this->pac) delete[] this->pac;
this->pac = NULL;
break;
}
@@ -313,7 +313,7 @@ bool proxy_factory::expand_wpad(const url &confurl)
rtv = true;
/* If the config has just changed from PAC to WPAD, clear the PAC */
if (!this->wpad) {
- if (this->pac) delete this->pac;
+ if (this->pac) delete[] this->pac;
if (this->pacurl) delete this->pacurl;
this->pac = NULL;
this->pacurl = NULL;
@@ -381,7 +381,7 @@ bool proxy_factory::expand_pac(url &confurl)
if (this->pac) {
if (this->pacurl->to_string() != confurl.to_string()) {
delete this->pacurl;
- delete this->pac;
+ delete[] this->pac;
this->pacurl = NULL;
this->pac = NULL;
}
@@ -424,7 +424,7 @@ void proxy_factory::run_pac(url &realurl, const url &confurl, vector<string> &re
void proxy_factory::clear_cache() {
this->wpad = false;
- if (this->pac) { delete this->pac; this->pac = NULL; }
+ if (this->pac) { delete[] this->pac; this->pac = NULL; }
if (this->pacurl) { delete this->pacurl; this->pacurl = NULL; }
}