Closed
Bug 155032
Opened 22 years ago
Closed 22 years ago
Memory leak of 18 bytes from 1 block allocated in nsSOCKSSocketInfo::GetProxyHost
Categories
(Core :: Networking, defect)
Tracking
()
VERIFIED
FIXED
mozilla1.1beta
People
(Reporter: stephend, Assigned: bbaetz)
Details
(Keywords: memory-leak)
Attachments
(1 file)
1.88 KB,
patch
|
smeredith
:
review+
alecf
:
superreview+
roc
:
approval+
|
Details | Diff | Splinter Review |
I hope this isn't bogus, but I see this on Windows 2000 running under Purify, just accessing my IMAP account with a SOCKS Proxy V5 server. If this turns out to be bogus, I'll invalidate it faster than you can exclaim 'Shazam'. [W] MLK: Memory leak of 18 bytes from 1 block allocated in PL_strdup Distribution of leaked blocks Allocation location malloc [MSVCRT.DLL] PL_strdup [strdup.c:46] nsSOCKSSocketInfo::GetProxyHost(char * *) [nsSOCKSIOLayer.cpp:103] if (!aProxyHost) return NS_ERROR_NULL_POINTER; if (mProxyHost) { => *aProxyHost = nsCRT::strdup(mProxyHost); return (*aProxyHost == nsnull) ? NS_ERROR_OUT_OF_MEMORY : NS_OK; } else ??? [ip=0x0922b288] nsSOCKSIOLayerConnect [nsSOCKSIOLayer.cpp:568] PRHostEnt hostentry; char * proxyHost; => nsresult rv = info->GetProxyHost(&proxyHost); if (NS_FAILED(rv) || !proxyHost || !(*proxyHost)) { return PR_FAILURE; PR_Connect [priometh.c:181] nsSocketTransport::doConnection(short) [nsSocketTransport.cpp:955] // This is only done the first time doConnection(...) is called. // if (NS_SUCCEEDED(rv)) { => status = PR_Connect(mSocketFD, mNetAddress, gConnectTimeout); if (PR_SUCCESS != status) { PRErrorCode code = PR_GetError(); // nsSocketTransport::Process(short) [nsSocketTransport.cpp:538] nsSocketTransportService::ProcessWorkQ(void) [nsSocketTransportService.cpp:317] nsSocketTransportService::Run(void) [nsSocketTransportService.cpp:563] nsThread::Main(void *) [nsThread.cpp:120] PR_NativeRunThread [pruthr.c:433] TlsSetValue [KERNEL32.dll]
Assignee | ||
Comment 1•22 years ago
|
||
This looks real. If you change like 566-570 in nsSOCKSIOLayer.cpp (the proxyHost delcaration) to: nsXPIDLCString proxyHost; nsresult rv = info->GetProxyHost(getter_Copies(proxyHost)); if (NS_FAILED(rv) || proxyHost.IsEmpty()) { then add .get() to fix the compile errors, does that fix the leak?
Reporter | ||
Comment 2•22 years ago
|
||
Add get() where? Can you just provide a patch that I can test, please? Thanks.
Assignee | ||
Comment 3•22 years ago
|
||
This compiles, but I haven't tested it runs.
Reporter | ||
Comment 4•22 years ago
|
||
This both works and seems to fix the leak on Windows 2000. SOCKS operations remain normal with this patch.
Comment 5•22 years ago
|
||
Comment on attachment 89706 [details] [diff] [review] patch r=smeredith
Attachment #89706 -
Flags: review+
Assignee | ||
Updated•22 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla1.1beta
Comment 6•22 years ago
|
||
Comment on attachment 89706 [details] [diff] [review] patch sr=alecf
Attachment #89706 -
Flags: superreview+
Comment on attachment 89706 [details] [diff] [review] patch a=roc+moz for TRUNK
Attachment #89706 -
Flags: approval+
Assignee | ||
Comment 8•22 years ago
|
||
Checked into trunk.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Reporter | ||
Comment 9•22 years ago
|
||
Verified FIXED, thanks for taking care of this so rapidly.
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•