Use nsCRT::free() instead of delete[] for char* data.

This commit is contained in:
bruce%cybersight.com 1999-09-03 14:08:47 +00:00
parent c48109f575
commit 64a22d4ee2
2 changed files with 3 additions and 2 deletions

View File

@ -22,6 +22,7 @@
#include "nsIPref.h" #include "nsIPref.h"
#include "nsIServiceManager.h" #include "nsIServiceManager.h"
#include "il_util.h" #include "il_util.h"
#include "nsCRT.h"
#include "nsDeviceContextGTK.h" #include "nsDeviceContextGTK.h"
#include "nsGfxCIID.h" #include "nsGfxCIID.h"
@ -361,7 +362,7 @@ NS_IMETHODIMP nsDeviceContextGTK::CheckFontExistence(const nsString& aFontName)
PR_snprintf(wildstring, namelen + 200, PR_snprintf(wildstring, namelen + 200,
"-*-%s-*-*-normal-*-*-*-%d-%d-*-*-*-*", "-*-%s-*-*-normal-*-*-*-%d-%d-*-*-*-*",
fontName, dpi, dpi); fontName, dpi, dpi);
delete [] fontName; nsCRT::free(fontName);
fnames = ::XListFontsWithInfo(GDK_DISPLAY(), wildstring, 1, &numnames, &fonts); fnames = ::XListFontsWithInfo(GDK_DISPLAY(), wildstring, 1, &numnames, &fonts);

View File

@ -240,7 +240,7 @@ nsXIFFormatConverter::Convert(const char *aFromDataFlavor, nsISupports *aFromDat
*aToData = genericDataWrapper; *aToData = genericDataWrapper;
NS_ADDREF(*aToData); NS_ADDREF(*aToData);
*aDataToLen = outStr.Length(); *aDataToLen = outStr.Length();
delete [] holderBecauseNSStringIsLame; nsCRT::free(holderBecauseNSStringIsLame);
} }
} }
} // if plain text } // if plain text