Bug 635782 - LSPAnnotationGatherer::Run should use nsAutoArrayPtr r=jmathies
authorCameron McCormack <cam@mcc.id.au>
Fri, 08 Apr 2011 10:51:34 +1200
changeset 67631 0e3ddf2b44135ee02b87cee831d866f55809a7eb
parent 67630 149b54c11f2afd3401990dc757a6046aec9b7535
child 67632 39c3c868dbd8bfe396cab69bbbb371b78316571c
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmathies
bugs635782
milestone2.2a1pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 635782 - LSPAnnotationGatherer::Run should use nsAutoArrayPtr r=jmathies
widget/src/windows/LSPAnnotator.cpp
--- a/widget/src/windows/LSPAnnotator.cpp
+++ b/widget/src/windows/LSPAnnotator.cpp
@@ -90,17 +90,17 @@ LSPAnnotationGatherer::Run()
   // Get the size of the buffer we need
   if (SOCKET_ERROR != WSCEnumProtocols(NULL, NULL, &size, &err) ||
       err != WSAENOBUFS) {
     // Er, what?
     NS_NOTREACHED("WSCEnumProtocols suceeded when it should have failed ...");
     return NS_ERROR_FAILURE;
   }
 
-  nsAutoPtr<char> byteArray = new char[size];
+  nsAutoArrayPtr<char> byteArray(new char[size]);
   WSAPROTOCOL_INFOW* providers =
     reinterpret_cast<WSAPROTOCOL_INFOW*>(byteArray.get());
 
   int n = WSCEnumProtocols(NULL, providers, &size, &err);
   if (n == SOCKET_ERROR) {
     // Lame. We provided the right size buffer; we'll just give up now.
     NS_WARNING("Could not get LSP list");
     return NS_ERROR_FAILURE;