mirror of
https://github.com/httptoolkit/frida-interception-and-unpinning.git
synced 2026-10-01 05:22:32 +02:00
Avoid needless reallocation of host & port strings on iOS
This is also extremely likely a memory leak since we're never cleaning these up - best to avoid that!
This commit is contained in:
@@ -29,11 +29,11 @@ const nw_endpoint_create_host = new NativeFunction(
|
||||
'pointer', ['pointer', 'pointer']
|
||||
);
|
||||
|
||||
const newHostStr = Memory.allocUtf8String(PROXY_HOST);
|
||||
const newPortStr = Memory.allocUtf8String(PROXY_PORT.toString());
|
||||
|
||||
Interceptor.attach(nw_connection_create, {
|
||||
onEnter: function (args) {
|
||||
const newHostStr = Memory.allocUtf8String(PROXY_HOST);
|
||||
const newPortStr = Memory.allocUtf8String(PROXY_PORT.toString());
|
||||
|
||||
// Replace the endpoint argument entirely with our own:
|
||||
args[0] = nw_endpoint_create_host(newHostStr, newPortStr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user