Bug 1020432 - Leak of |buf| in nsAuthSambaNTLM::GetNextToken, r=honzab
authorNochum Sossonko <highmind63@gmail.com>
Sun, 22 Jun 2014 11:10:08 -0700
changeset 189961 35c527229cdba117043ea9878c7399773dee8902
parent 189960 e3ab11ba56a5f9ddbbf83cfbdbdedcbe53660eae
child 189962 efaa172c0ee49833d298df1ab6f1af5f779dc236
push id26999
push userryanvm@gmail.com
push dateMon, 23 Jun 2014 14:42:40 +0000
treeherdermozilla-central@4a7f4ed3f08b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershonzab
bugs1020432
milestone33.0a1
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 1020432 - Leak of |buf| in nsAuthSambaNTLM::GetNextToken, r=honzab
extensions/auth/nsAuthSambaNTLM.cpp
--- a/extensions/auth/nsAuthSambaNTLM.cpp
+++ b/extensions/auth/nsAuthSambaNTLM.cpp
@@ -260,18 +260,18 @@ nsAuthSambaNTLM::GetNextToken(const void
         // Something went wrong. Perhaps no credentials are accessible.
         return NS_ERROR_FAILURE;
     }
     uint8_t* buf = ExtractMessage(line, outTokenLen);
     if (!buf)
         return NS_ERROR_FAILURE;
     // *outToken has to be freed by nsMemory::Free, which may not be free() 
     *outToken = nsMemory::Clone(buf, *outTokenLen);
+    free(buf);
     if (!*outToken) {
-        free(buf);
         return NS_ERROR_OUT_OF_MEMORY;
     }
     
     // We're done. Close our file descriptors now and reap the helper
     // process.
     Shutdown();
     return NS_SUCCESS_AUTH_FINISHED;
 }