Bug 901820 - Part 1. replace nsCRT::strdup with strdup. r=bsmedberg
authorMakoto Kato <m_kato@ga2.so-net.ne.jp>
Thu, 22 Aug 2013 19:31:48 +0900
changeset 143892 5cfc41cf48d9d53a6f0c53f949a28bb1df1cf59f
parent 143891 396f485ff2e32eefe6be384ab620293e0c99b1aa
child 143893 94fd01624434761da832eba8c0a034a61232c773
push id25143
push userryanvm@gmail.com
push dateThu, 22 Aug 2013 19:42:42 +0000
treeherdermozilla-central@d58fc624899c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs901820
milestone26.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 901820 - Part 1. replace nsCRT::strdup with strdup. r=bsmedberg
intl/locale/src/os2/nsCollationOS2.cpp
intl/strres/src/nsStringBundle.cpp
intl/unicharutil/src/nsSaveAsCharset.cpp
netwerk/base/src/nsStandardURL.cpp
netwerk/protocol/http/nsHttpAuthCache.cpp
netwerk/protocol/http/nsHttpHandler.cpp
netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
netwerk/test/TestRes.cpp
security/manager/ssl/src/nsCMSSecureMessage.cpp
security/manager/ssl/src/nsKeygenHandler.cpp
security/manager/ssl/src/nsPKCS12Blob.cpp
toolkit/components/startup/nsUserInfoUnix.cpp
widget/gtk2/nsDragService.cpp
widget/windows/nsDeviceContextSpecWin.cpp
widget/windows/nsPrintSettingsWin.cpp
widget/xpwidgets/nsTransferable.cpp
xpcom/base/nsTraceRefcntImpl.cpp
xpcom/ds/nsProperties.cpp
xpfe/components/directory/nsDirectoryViewer.cpp
--- a/intl/locale/src/os2/nsCollationOS2.cpp
+++ b/intl/locale/src/os2/nsCollationOS2.cpp
@@ -126,17 +126,17 @@ nsresult nsCollationOS2::AllocateRawSort
       // Do the Xfrm
       int uLen = UniStrxfrm(locObj, pLocalBuffer, reinterpret_cast<const UniChar *>(stringNormalized.get()), iBufferLength);
       // See how big the result really is
       uLen = UniStrlen(pLocalBuffer);
       // make sure it will fit in the output buffer...
       if (uLen < iBufferLength) {
           // Success!
           // Give 'em the real size in bytes...
-          *key = (uint8_t *)nsCRT::strdup((PRUnichar*) pLocalBuffer);
+          *key = (uint8_t *)NS_strdup((PRUnichar*) pLocalBuffer);
           *outLen = uLen * 2 + 2;
           res = NS_OK;
       }
     }
   }
   UniFreeLocaleObject(locObj);
 
   return res;
--- a/intl/strres/src/nsStringBundle.cpp
+++ b/intl/strres/src/nsStringBundle.cpp
@@ -766,17 +766,17 @@ nsStringBundleService::FormatStatusMessa
 {
   nsresult rv;
   uint32_t i, argCount = 0;
   nsCOMPtr<nsIStringBundle> bundle;
   nsXPIDLCString stringBundleURL;
 
   // XXX hack for mailnews who has already formatted their messages:
   if (aStatus == NS_OK && aStatusArg) {
-    *result = nsCRT::strdup(aStatusArg);
+    *result = NS_strdup(aStatusArg);
     NS_ENSURE_TRUE(*result, NS_ERROR_OUT_OF_MEMORY);
     return NS_OK;
   }
 
   if (aStatus == NS_OK) {
     return NS_ERROR_FAILURE;       // no message to format
   }
 
--- a/intl/unicharutil/src/nsSaveAsCharset.cpp
+++ b/intl/unicharutil/src/nsSaveAsCharset.cpp
@@ -117,17 +117,17 @@ nsSaveAsCharset::GetCharset(char * *aCha
 
   const char* charset = mCharsetList[mCharsetListIndex].get();
   if (!charset) {
     *aCharset = nullptr;
     NS_ASSERTION(charset, "make sure to call Init() with non empty charset list");
     return NS_ERROR_FAILURE;
   }
 
-  *aCharset = nsCRT::strdup(charset);
+  *aCharset = strdup(charset);
   return (*aCharset) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
 }
 
 /////////////////////////////////////////////////////////////////////////////////////////
 
 #define RESERVE_FALLBACK_BYTES 512
 
 // do the fallback, reallocate the buffer if necessary
--- a/netwerk/base/src/nsStandardURL.cpp
+++ b/netwerk/base/src/nsStandardURL.cpp
@@ -279,17 +279,19 @@ nsStandardURL::nsStandardURL(bool aSuppo
     PR_APPEND_LINK(&mDebugCList, &gAllURLs);
 #endif
 }
 
 nsStandardURL::~nsStandardURL()
 {
     LOG(("Destroying nsStandardURL @%p\n", this));
 
-    CRTFREEIF(mHostA);
+    if (mHostA) {
+        free(mHostA);
+    }
 #ifdef DEBUG_DUMP_URLS_AT_SHUTDOWN
     PR_REMOVE_LINK(&mDebugCList);
 #endif
 }
 
 #ifdef DEBUG_DUMP_URLS_AT_SHUTDOWN
 struct DumpLeakedURLs {
     DumpLeakedURLs() {}
@@ -370,17 +372,20 @@ nsStandardURL::Clear()
     InvalidateCache();
 }
 
 void
 nsStandardURL::InvalidateCache(bool invalidateCachedFile)
 {
     if (invalidateCachedFile)
         mFile = 0;
-    CRTFREEIF(mHostA);
+    if (mHostA) {
+        free(mHostA);
+        mHostA = nullptr;
+    }
     mSpecEncoding = eEncoding_Unknown;
 }
 
 bool
 nsStandardURL::EscapeIPv6(const char *host, nsCString &result)
 {
     // Escape IPv6 address literal by surrounding it with []'s
     if (host && (host[0] != '[') && PL_strchr(host, ':')) {
@@ -1738,17 +1743,17 @@ nsStandardURL::CloneInternal(nsStandardU
     clone->mBasename = mBasename;
     clone->mExtension = mExtension;
     clone->mQuery = mQuery;
     clone->mRef = mRef;
     clone->mOriginCharset = mOriginCharset;
     clone->mURLType = mURLType;
     clone->mParser = mParser;
     clone->mFile = mFile;
-    clone->mHostA = mHostA ? nsCRT::strdup(mHostA) : nullptr;
+    clone->mHostA = mHostA ? strdup(mHostA) : nullptr;
     clone->mMutable = true;
     clone->mSupportsFileURL = mSupportsFileURL;
     clone->mHostEncoding = mHostEncoding;
     clone->mSpecEncoding = mSpecEncoding;
 
     if (refHandlingMode == eIgnoreRef) {
         clone->SetRef(EmptyCString());
     }
--- a/netwerk/protocol/http/nsHttpAuthCache.cpp
+++ b/netwerk/protocol/http/nsHttpAuthCache.cpp
@@ -164,17 +164,17 @@ nsHttpAuthCache::SetAuthEntry(const char
         // create a new entry node and set the given entry
         node = new nsHttpAuthNode();
         if (!node)
             return NS_ERROR_OUT_OF_MEMORY;
         rv = node->SetAuthEntry(path, realm, creds, challenge, ident, metadata);
         if (NS_FAILED(rv))
             delete node;
         else
-            PL_HashTableAdd(mDB, nsCRT::strdup(key.get()), node);
+            PL_HashTableAdd(mDB, strdup(key.get()), node);
         return rv;
     }
 
     return node->SetAuthEntry(path, realm, creds, challenge, ident, metadata);
 }
 
 void
 nsHttpAuthCache::ClearAuthEntry(const char *scheme,
@@ -249,17 +249,17 @@ nsHttpAuthCache::FreeEntry(void *self, P
         // this would only happen if PL_HashTableAdd were to replace an
         // existing entry in the hash table, but we _always_ do a lookup
         // before adding a new entry to avoid this case.
         NS_NOTREACHED("should never happen");
     }
     else if (flag == HT_FREE_ENTRY) {
         // three wonderful flavors of freeing memory ;-)
         delete (nsHttpAuthNode *) he->value;
-        nsCRT::free((char *) he->key);
+        free((char *) he->key);
         free(he);
     }
 }
 
 PLHashAllocOps nsHttpAuthCache::gHashAllocOps =
 {
     nsHttpAuthCache::AllocTable,
     nsHttpAuthCache::FreeTable,
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -1416,28 +1416,28 @@ PrepareAcceptLanguages(const char *i_Acc
         return NS_OK;
 
     uint32_t n, count_n, size, wrote;
     double q, dec;
     char *p, *p2, *token, *q_Accept, *o_Accept;
     const char *comma;
     int32_t available;
 
-    o_Accept = nsCRT::strdup(i_AcceptLanguages);
+    o_Accept = strdup(i_AcceptLanguages);
     if (!o_Accept)
         return NS_ERROR_OUT_OF_MEMORY;
     for (p = o_Accept, n = size = 0; '\0' != *p; p++) {
         if (*p == ',') n++;
             size++;
     }
 
     available = size + ++n * 11 + 1;
     q_Accept = new char[available];
     if (!q_Accept) {
-        nsCRT::free(o_Accept);
+        free(o_Accept);
         return NS_ERROR_OUT_OF_MEMORY;
     }
     *q_Accept = '\0';
     q = 1.0;
     dec = q / (double) n;
     count_n = 0;
     p2 = q_Accept;
     for (token = nsCRT::strtok(o_Accept, ",", &p);
@@ -1474,17 +1474,17 @@ PrepareAcceptLanguages(const char *i_Acc
             }
 
             q -= dec;
             p2 += wrote;
             available -= wrote;
             MOZ_ASSERT(available > 0, "allocated string not long enough");
         }
     }
-    nsCRT::free(o_Accept);
+    free(o_Accept);
 
     o_AcceptLanguages.Assign((const char *) q_Accept);
     delete [] q_Accept;
 
     return NS_OK;
 }
 
 nsresult
--- a/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
+++ b/netwerk/streamconv/converters/mozTXTToHTMLConv.cpp
@@ -1342,17 +1342,17 @@ mozTXTToHTMLConv::ScanTXT(const PRUnicha
   // FIX ME!!!
   nsString outString;
   int32_t inLength = NS_strlen(text);
   // by setting a large capacity up front, we save time
   // when appending characters to the output string because we don't
   // need to reallocate and re-copy the characters already in the out String.
   NS_ASSERTION(inLength, "ScanTXT passed 0 length string");
   if (inLength == 0) {
-    *_retval = nsCRT::strdup(text);
+    *_retval = NS_strdup(text);
     return NS_OK;
   }
 
   outString.SetCapacity(uint32_t(inLength * growthRate));
   ScanTXT(text, inLength, whattodo, outString);
 
   *_retval = ToNewUnicode(outString);
   return *_retval ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
--- a/netwerk/test/TestRes.cpp
+++ b/netwerk/test/TestRes.cpp
@@ -82,24 +82,24 @@ TestOpenInputStream(const char* url)
     nsCOMPtr<nsIURI> uri;
     char* str;
 
     rv = channel->GetOriginalURI(getter_AddRefs(uri));
     if (NS_FAILED(rv)) return rv;
     rv = uri->GetSpec(&str);
     if (NS_FAILED(rv)) return rv;
     fprintf(stdout, "%s resolved to ", str);
-    nsCRT::free(str);
+    free(str);
 
     rv = channel->GetURI(getter_AddRefs(uri));
     if (NS_FAILED(rv)) return rv;
     rv = uri->GetSpec(&str);
     if (NS_FAILED(rv)) return rv;
     fprintf(stdout, "%s\n", str);
-    nsCRT::free(str);
+    free(str);
 
     return NS_OK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 
 bool gDone = false;
 nsIEventQueue* gEventQ = nullptr;
@@ -118,17 +118,17 @@ public:
         nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
 
         rv = channel->GetURI(getter_AddRefs(uri));
         if (NS_SUCCEEDED(rv)) {
             char* str;
             rv = uri->GetSpec(&str);
             if (NS_SUCCEEDED(rv)) {
                 fprintf(stdout, "Starting to load %s\n", str);
-                nsCRT::free(str);
+                free(str);
             }
         }
         return NS_OK;
     }
 
     NS_IMETHOD OnStopRequest(nsIRequest *request, nsISupports *ctxt, 
                              nsresult aStatus) {
         nsresult rv;
@@ -136,17 +136,17 @@ public:
         nsCOMPtr<nsIChannel> channel = do_QueryInterface(request);
 
         rv = channel->GetURI(getter_AddRefs(uri));
         if (NS_SUCCEEDED(rv)) {
             char* str;
             rv = uri->GetSpec(&str);
             if (NS_SUCCEEDED(rv)) {
                 fprintf(stdout, "Ending load %s, status=%x\n", str, aStatus);
-                nsCRT::free(str);
+                free(str);
             }
         }
         gDone = true;
         return NS_OK;
     }
 
     NS_IMETHOD OnDataAvailable(nsIRequest *request, nsISupports *ctxt, 
                                nsIInputStream *inStr,
--- a/security/manager/ssl/src/nsCMSSecureMessage.cpp
+++ b/security/manager/ssl/src/nsCMSSecureMessage.cpp
@@ -117,17 +117,17 @@ DecodeCert(const char *value, nsIX509Cer
   if (cert) {
     *_retval = cert;
     NS_ADDREF(*_retval);
   }
   else {
     rv = NS_ERROR_FAILURE;
   }
 
-  nsCRT::free((char*)data);
+  free((char*)data);
   return rv;
 }
 
 // nsCMSSecureMessage::SendMessage
 nsresult nsCMSSecureMessage::
 SendMessage(const char *msg, const char *base64Cert, char ** _retval)
 {
   nsNSSShutDownPreventionLock locker;
@@ -239,17 +239,17 @@ SendMessage(const char *msg, const char 
     rv = NS_ERROR_FAILURE;
     goto done;
   }
 
   /* Step 7. Base64 encode and return the result */
   rv = encode(output.data, output.len, _retval);
 
 done:
-  if (certDER) nsCRT::free((char *)certDER);
+  if (certDER) free((char *)certDER);
   if (cert) CERT_DestroyCertificate(cert);
   if (cmsMsg) NSS_CMSMessage_Destroy(cmsMsg);
   if (arena) PORT_FreeArena(arena, false);  /* false? */
 
   return rv;
 }
 
 /*
--- a/security/manager/ssl/src/nsKeygenHandler.cpp
+++ b/security/manager/ssl/src/nsKeygenHandler.cpp
@@ -719,17 +719,17 @@ nsKeygenFormProcessor::GetPublicKey(nsAS
      */
     keystring = BTOA_DataToAscii(signedItem.data, signedItem.len);
     if (!keystring) {
         rv = NS_ERROR_OUT_OF_MEMORY;
         goto loser;
     }
 
     CopyASCIItoUTF16(keystring, aOutPublicKey);
-    nsCRT::free(keystring);
+    free(keystring);
 
     rv = NS_OK;
 loser:
     if ( sec_rv != SECSuccess ) {
         if ( privateKey ) {
             PK11_DestroyTokenObject(privateKey->pkcs11Slot,privateKey->pkcs11ID);
         }
         if ( publicKey ) {
--- a/security/manager/ssl/src/nsPKCS12Blob.cpp
+++ b/security/manager/ssl/src/nsPKCS12Blob.cpp
@@ -729,17 +729,17 @@ nsPKCS12Blob::nickname_collision(SECItem
     CERT_DestroyCertificate(cert);
     count++;
   }
   SECItem *newNick = new SECItem;
   if (!newNick)
     return nullptr;
 
   newNick->type = siAsciiString;
-  newNick->data = (unsigned char*) nsCRT::strdup(nickname.get());
+  newNick->data = (unsigned char*) strdup(nickname.get());
   newNick->len  = strlen((char*)newNick->data);
   return newNick;
 }
 
 // write_export_file
 // write bytes to the exported PKCS#12 file
 void
 nsPKCS12Blob::write_export_file(void *arg, const char *buf, unsigned long len)
--- a/toolkit/components/startup/nsUserInfoUnix.cpp
+++ b/toolkit/components/startup/nsUserInfoUnix.cpp
@@ -87,17 +87,17 @@ nsUserInfo::GetUsername(char * *aUsernam
     pw = getpwuid(geteuid());
 
     if (!pw || !pw->pw_name) return NS_ERROR_FAILURE;
 
 #ifdef DEBUG_sspitzer
     printf("username = %s\n", pw->pw_name);
 #endif
 
-    *aUsername = nsCRT::strdup(pw->pw_name);
+    *aUsername = strdup(pw->pw_name);
 
     return NS_OK;
 }
 
 NS_IMETHODIMP 
 nsUserInfo::GetDomain(char * *aDomain)
 {
     nsresult rv = NS_ERROR_FAILURE;
@@ -112,28 +112,28 @@ nsUserInfo::GetDomain(char * *aDomain)
 
 #if defined(HAVE_UNAME_DOMAINNAME_FIELD)
     domainname = buf.domainname;
 #elif defined(HAVE_UNAME_US_DOMAINNAME_FIELD)
     domainname = buf.__domainname;
 #endif
 
     if (domainname && domainname[0]) {   
-        *aDomain = nsCRT::strdup(domainname);
+        *aDomain = strdup(domainname);
         rv = NS_OK;
     }
     else {
         // try to get the hostname from the nodename
         // on machines that use DHCP, domainname may not be set
         // but the nodename might.
         if (buf.nodename && buf.nodename[0]) {
             // if the nodename is foo.bar.org, use bar.org as the domain
             char *pos = strchr(buf.nodename,'.');
             if (pos) {
-                *aDomain = nsCRT::strdup(pos+1);
+                *aDomain = strdup(pos+1);
                 rv = NS_OK;
             }
         }
     }
     
     return rv;
 }
 
--- a/widget/gtk2/nsDragService.cpp
+++ b/widget/gtk2/nsDragService.cpp
@@ -1454,17 +1454,17 @@ nsDragService::SourceDataGet(GtkWidget  
     typeName = gdk_atom_name(target);
     if (!typeName) {
         PR_LOG(sDragLm, PR_LOG_DEBUG, ("failed to get atom name.\n"));
         return;
     }
 
     PR_LOG(sDragLm, PR_LOG_DEBUG, ("Type is %s\n", typeName));
     // make a copy since |nsXPIDLCString| won't use |g_free|...
-    mimeFlavor.Adopt(nsCRT::strdup(typeName));
+    mimeFlavor.Adopt(strdup(typeName));
     g_free(typeName);
     // check to make sure that we have data items to return.
     if (!mSourceDataItems) {
         PR_LOG(sDragLm, PR_LOG_DEBUG, ("Failed to get our data items\n"));
         return;
     }
 
     nsCOMPtr<nsISupports> genericItem;
--- a/widget/windows/nsDeviceContextSpecWin.cpp
+++ b/widget/windows/nsDeviceContextSpecWin.cpp
@@ -396,31 +396,31 @@ NS_IMETHODIMP nsDeviceContextSpecWin::In
 
         SetDeviceName(deviceName);
         SetDriverName(driverName);
         SetDevMode(devMode);
 
         if (!aIsPrintPreview) {
           rv = CheckForPrintToFile(mPrintSettings, deviceName, nullptr);
           if (NS_FAILED(rv)) {
-            nsCRT::free(deviceName);
-            nsCRT::free(driverName);
+            free(deviceName);
+            free(driverName);
             return NS_ERROR_FAILURE;
           }
         }
 
         // clean up
-        nsCRT::free(deviceName);
-        nsCRT::free(driverName);
+        free(deviceName);
+        free(driverName);
 
         return NS_OK;
       } else {
         PR_PL(("***** nsDeviceContextSpecWin::Init - deviceName/driverName/devMode was NULL!\n"));
-        if (deviceName) nsCRT::free(deviceName);
-        if (driverName) nsCRT::free(driverName);
+        if (deviceName) free(deviceName);
+        if (driverName) free(driverName);
         if (devMode) ::HeapFree(::GetProcessHeap(), 0, devMode);
       }
     }
   } else {
     PR_PL(("***** nsDeviceContextSpecWin::Init - aPrintSettingswas NULL!\n"));
   }
 
   // Get the Print Name to be used
--- a/widget/windows/nsPrintSettingsWin.cpp
+++ b/widget/windows/nsPrintSettingsWin.cpp
@@ -127,21 +127,21 @@ nsPrintSettingsWin& nsPrintSettingsWin::
 {
   if (this == &rhs) {
     return *this;
   }
 
   ((nsPrintSettings&) *this) = rhs;
 
   if (mDeviceName) {
-    nsCRT::free(mDeviceName);
+    free(mDeviceName);
   }
 
   if (mDriverName) {
-    nsCRT::free(mDriverName);
+    free(mDriverName);
   }
 
   // Use free because we used the native malloc to create the memory
   if (mDevMode) {
     ::HeapFree(::GetProcessHeap(), 0, mDevMode);
   }
 
   mDeviceName = rhs.mDeviceName?wcsdup(rhs.mDeviceName):nullptr;
--- a/widget/xpwidgets/nsTransferable.cpp
+++ b/widget/xpwidgets/nsTransferable.cpp
@@ -46,17 +46,17 @@ uint32_t GetDataForFlavor (const nsTArra
   }
 
   return aArray.NoIndex;
 }
 
 //-------------------------------------------------------------------------
 DataStruct::~DataStruct() 
 { 
-  if (mCacheFileName) nsCRT::free(mCacheFileName); 
+  if (mCacheFileName) free(mCacheFileName); 
 }
 
 //-------------------------------------------------------------------------
 void
 DataStruct::SetData ( nsISupports* aData, uint32_t aDataLen )
 {
   // Now, check to see if we consider the data to be "too large"
   if (aDataLen > kLargeDatasetSize) {
@@ -128,17 +128,17 @@ DataStruct::WriteCache(nsISupports* aDat
 {
   // Get a new path and file to the temp directory
   nsCOMPtr<nsIFile> cacheFile = GetFileSpec(mCacheFileName);
   if (cacheFile) {
     // remember the file name
     if (!mCacheFileName) {
       nsXPIDLCString fName;
       cacheFile->GetNativeLeafName(fName);
-      mCacheFileName = nsCRT::strdup(fName);
+      mCacheFileName = strdup(fName);
     }
 
     // write out the contents of the clipboard
     // to the file
     //uint32_t bytes;
     nsCOMPtr<nsIOutputStream> outStr;
 
     NS_NewLocalFileOutputStream(getter_AddRefs(outStr),
--- a/xpcom/base/nsTraceRefcntImpl.cpp
+++ b/xpcom/base/nsTraceRefcntImpl.cpp
@@ -180,18 +180,17 @@ SerialNumberFreeEntry(void *pool, PLHash
         PR_Free(he);
     }
 }
 
 static void
 TypesToLogFreeEntry(void *pool, PLHashEntry *he, unsigned flag)
 {
     if (flag == HT_FREE_ENTRY) {
-        nsCRT::free(const_cast<char*>
-                              (reinterpret_cast<const char*>(he->key)));
+        free(const_cast<char*>(reinterpret_cast<const char*>(he->key)));
         PR_Free(he);
     }
 }
 
 static const PLHashAllocOps serialNumberHashAllocOps = {
     DefaultAllocTable, DefaultFreeTable,
     DefaultAllocEntry, SerialNumberFreeEntry
 };
@@ -753,17 +752,17 @@ static void InitTraceLog(void)
     else {
       fprintf(stdout, "### XPCOM_MEM_LOG_CLASSES defined -- only logging these classes: ");
       const char* cp = classes;
       for (;;) {
         char* cm = (char*) strchr(cp, ',');
         if (cm) {
           *cm = '\0';
         }
-        PL_HashTableAdd(gTypesToLog, nsCRT::strdup(cp), (void*)1);
+        PL_HashTableAdd(gTypesToLog, strdup(cp), (void*)1);
         fprintf(stdout, "%s ", cp);
         if (!cm) break;
         *cm = ',';
         cp = cm + 1;
       }
       fprintf(stdout, "\n");
     }
 
--- a/xpcom/ds/nsProperties.cpp
+++ b/xpcom/ds/nsProperties.cpp
@@ -65,17 +65,17 @@ struct GetKeysEnumData
     nsresult res;
 };
 
  PLDHashOperator
 GetKeysEnumerate(const char *key, nsISupports* data,
                  void *arg)
 {
     GetKeysEnumData *gkedp = (GetKeysEnumData *)arg;
-    gkedp->keys[gkedp->next] = nsCRT::strdup(key);
+    gkedp->keys[gkedp->next] = strdup(key);
 
     if (!gkedp->keys[gkedp->next]) {
         gkedp->res = NS_ERROR_OUT_OF_MEMORY;
         return PL_DHASH_STOP;
     }
 
     gkedp->next++;
     return PL_DHASH_NEXT;
--- a/xpfe/components/directory/nsDirectoryViewer.cpp
+++ b/xpfe/components/directory/nsDirectoryViewer.cpp
@@ -700,17 +700,17 @@ void nsHTTPIndex::GetDestination(nsIRDFR
   nsCOMPtr<nsIRDFLiteral> url;
   
   if (node)
     url = do_QueryInterface(node);
 
   if (!url) {
      const char* temp;
      r->GetValueConst(&temp);
-     dest.Adopt(temp ? nsCRT::strdup(temp) : 0);
+     dest.Adopt(temp ? strdup(temp) : 0);
   } else {
     const PRUnichar* uri;
     url->GetValueConst(&uri);
     dest.Adopt(ToNewUTF8String(nsDependentString(uri)));
   }
 }
 
 // rjc: isWellknownContainerURI() decides whether a URI is a container for which,
@@ -751,17 +751,17 @@ nsHTTPIndex::isWellknownContainerURI(nsI
 
 NS_IMETHODIMP
 nsHTTPIndex::GetURI(char * *uri)
 {
 	NS_PRECONDITION(uri != nullptr, "null ptr");
 	if (! uri)
 		return(NS_ERROR_NULL_POINTER);
 
-	if ((*uri = nsCRT::strdup("rdf:httpindex")) == nullptr)
+	if ((*uri = strdup("rdf:httpindex")) == nullptr)
 		return(NS_ERROR_OUT_OF_MEMORY);
 
 	return(NS_OK);
 }
 
 
 
 NS_IMETHODIMP