diff options
author | npmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56> | 2010-03-05 23:17:50 +0000 |
---|---|---|
committer | npmccallum <npmccallum@c587cffe-e639-0410-9787-d7902ae8ed56> | 2010-03-05 23:17:50 +0000 |
commit | 6a4af63f2157cffae6b11a380ff50ee779c38f21 (patch) | |
tree | c3bb6b4a1ae4caf1cde8657ff49c858d7e6ea2db /libproxy/proxy.cpp | |
parent | 87d2727ecd1ccc6ea80b7b2902ab7e42ce2d0510 (diff) | |
download | libproxy-6a4af63f2157cffae6b11a380ff50ee779c38f21.tar.gz |
correct some delete references; fixes issue 91; patch from Erik van Pienbroek
git-svn-id: http://libproxy.googlecode.com/svn/trunk@595 c587cffe-e639-0410-9787-d7902ae8ed56
Diffstat (limited to 'libproxy/proxy.cpp')
-rw-r--r-- | libproxy/proxy.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/libproxy/proxy.cpp b/libproxy/proxy.cpp index 5f34e98..fb7a26c 100644 --- a/libproxy/proxy.cpp +++ b/libproxy/proxy.cpp @@ -388,7 +388,8 @@ extern "C" DLL_PUBLIC char** px_proxy_factory_get_proxies(struct pxProxyFactory_ // Call the main method try { proxies = self->pf.get_proxies(url); - retval = new char*[proxies.size()+1]; + retval = (char**) malloc(sizeof(char*) * (proxies.size() + 1)); + if (!retval) return NULL; } catch (std::exception&) { // Return NULL on any exception return NULL; @@ -402,7 +403,7 @@ extern "C" DLL_PUBLIC char** px_proxy_factory_get_proxies(struct pxProxyFactory_ if (retval[i] == NULL) { for (int j=i-1 ; j >= 0 ; j--) free(retval[j]); - delete retval; + free(retval); return NULL; } } |