libproxy/libproxy-0.4.12-use-correct-delete.patch

63 lines
1.9 KiB
Diff

From 6efcbd3fa0944b499180c7bc860d38c1b18c97f1 Mon Sep 17 00:00:00 2001
From: Fabian Vogt <fabian@ritter-vogt.de>
Date: Tue, 16 Feb 2016 22:13:56 +0100
Subject: [PATCH] Fix mismatched new[]/delete in pacrunner_natus and _webkit
---
libproxy/modules/pacrunner_natus.cpp | 4 ++--
libproxy/modules/pacrunner_webkit.cpp | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/libproxy/modules/pacrunner_natus.cpp b/libproxy/modules/pacrunner_natus.cpp
index ce79943..72ef6ff 100644
--- a/libproxy/modules/pacrunner_natus.cpp
+++ b/libproxy/modules/pacrunner_natus.cpp
@@ -43,14 +43,14 @@ static Value dnsResolve(Value& ths, Value& fnc, vector<Value>& arg) {
NULL, 0,
NI_NUMERICHOST)) {
freeaddrinfo(info);
- delete tmp;
+ delete[] tmp;
return NULL;
}
freeaddrinfo(info);
// Create the return value
Value ret = ths.newString(tmp);
- delete tmp;
+ delete[] tmp;
return ret;
}
diff --git a/libproxy/modules/pacrunner_webkit.cpp b/libproxy/modules/pacrunner_webkit.cpp
index c51b869..bef2056 100644
--- a/libproxy/modules/pacrunner_webkit.cpp
+++ b/libproxy/modules/pacrunner_webkit.cpp
@@ -58,7 +58,7 @@ static JSValueRef dnsResolve(JSContextRef ctx, JSObjectRef /*func*/, JSObjectRef
struct addrinfo *info;
if (getaddrinfo(tmp, NULL, NULL, &info))
return NULL;
- delete tmp;
+ delete[] tmp;
// Try for IPv4
tmp = new char[INET6_ADDRSTRLEN+1];
@@ -67,7 +67,7 @@ static JSValueRef dnsResolve(JSContextRef ctx, JSObjectRef /*func*/, JSObjectRef
NULL, 0,
NI_NUMERICHOST)) {
freeaddrinfo(info);
- delete tmp;
+ delete[] tmp;
return NULL;
}
freeaddrinfo(info);
@@ -76,7 +76,7 @@ static JSValueRef dnsResolve(JSContextRef ctx, JSObjectRef /*func*/, JSObjectRef
JSStringRef str = JSStringCreateWithUTF8CString(tmp);
JSValueRef ret = JSValueMakeString(ctx, str);
JSStringRelease(str);
- delete tmp;
+ delete[] tmp;
return ret;
}