Bug 20377 - REGRESSION: Leaks on TOT
Summary: REGRESSION: Leaks on TOT
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P1 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-13 17:54 PDT by Eric Seidel (no email)
Modified: 2008-08-25 18:53 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eric Seidel (no email) 2008-08-13 17:54:59 PDT
Leak: 0x173ddf30  size=32	
	0x1b429650 0x00000040 0x0000003f 0x00000001 	P.B.@...?.......
	0x00000000 0x00000000 0x08000100 0x00020000 	................
	Call stack: [thread 17fffff]: | 0x2 | start | _start | main | dumpRenderTree(int, char const**) | runTestingServerLoop() | runTest(char const*) | -[NSRunLoop runMode:beforeDate:] | CFRunLoopRunInMode | CFRunLoopRunSpecific | _sendCallbacks | -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] | -[NSURLConnection(NSURLConnectionInternal) _sendDidReceiveResponseCallback] | -[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:] | WebCore::ResourceLoader::didReceiveResponse(WebCore::ResourceHandle*, WebCore::ResourceResponse const&) | WebCore::SubresourceLoader::didReceiveResponse(WebCore::ResourceResponse const&) | WebCore::XMLHttpRequest::didReceiveResponse(WebCore::SubresourceLoader*, WebCore::ResourceResponse const&) | WebCore::XMLHttpRequest::didReceiveResponsePreflight(WebCore::SubresourceLoader*, WebCore::ResourceResponse const&) | WTF::fastMalloc(unsigned long) | malloc
Comment 1 Eric Seidel (no email) 2008-08-13 17:55:15 PDT
This would fix it, but an ownptr would be cleaner:

diff --git a/WebCore/xml/XMLHttpRequest.cpp b/WebCore/xml/XMLHttpRequest.cpp
index 072f7fa..af70409 100644
--- a/WebCore/xml/XMLHttpRequest.cpp
+++ b/WebCore/xml/XMLHttpRequest.cpp
@@ -625,8 +625,10 @@ void XMLHttpRequest::makeCrossSiteAccessRequestWithPreflight(ExceptionCode& ec)
     PreflightResultCache::iterator cacheIt = preflightResultCache().find(std::make_pair(origin, url));
     if (cacheIt != preflightResultCache().end()) {
         skipPreflight = canSkipPrelight(cacheIt, m_includeCredentials, m_method, m_requestHeaders);
-        if (!skipPreflight)
+        if (!skipPreflight) {
+            delete *cacheIt;
             preflightResultCache().remove(cacheIt);
+        }
     }
 
     if (!skipPreflight) {
Comment 2 Eric Seidel (no email) 2008-08-13 17:55:37 PDT
http://build.webkit.org/results/trunk-mac-intel-debug/4820/
Comment 3 Sam Weinig 2008-08-25 18:53:05 PDT
Fixed in r35927.