зеркало из https://github.com/mozilla/gecko-dev.git
Use nsCRT::free() instead of delete[] for char* data.
This commit is contained in:
Родитель
4fc6b7833c
Коммит
443ae40b6e
|
@ -1101,7 +1101,7 @@ GlobalWindowImpl::Dump(const nsString& aStr)
|
|||
|
||||
if (nsnull != cstr) {
|
||||
printf("%s", cstr);
|
||||
delete [] cstr;
|
||||
nsCRT::free(cstr);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -2438,7 +2438,7 @@ GlobalWindowImpl::CheckWindowName(JSContext *cx, nsString& aName)
|
|||
JS_ReportError(cx,
|
||||
"illegal character '%c' ('\\%o') in window name %s",
|
||||
mChar, mChar, cp);
|
||||
delete [] cp;
|
||||
nsCRT::free(cp);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,7 +143,7 @@ nsDOMNativeObjectRegistry::RemoveStrings(PLHashEntry *he, PRIntn i, void *arg)
|
|||
{
|
||||
char *str = (char *)he->key;
|
||||
|
||||
delete [] str;
|
||||
nsCRT::free(str);
|
||||
return HT_ENUMERATE_REMOVE;
|
||||
}
|
||||
|
||||
|
@ -183,7 +183,7 @@ nsDOMNativeObjectRegistry::GetFactoryCID(const nsString& aClassName,
|
|||
|
||||
char *name = aClassName.ToNewCString();
|
||||
nsIID *classId = (nsIID *)PL_HashTableLookup(mFactories, name);
|
||||
delete[] name;
|
||||
nsCRT::free(name);
|
||||
|
||||
aCID = *classId;
|
||||
|
||||
|
@ -378,7 +378,7 @@ nsDOMScriptObjectFactory::NewScriptElement(const nsString &aTagName,
|
|||
nsDOMHTMLTag tag = NS_DOMTagToEnum(str);
|
||||
|
||||
if (str) {
|
||||
delete[] str;
|
||||
nsCRT::free(str);
|
||||
}
|
||||
|
||||
switch (tag) {
|
||||
|
|
|
@ -81,11 +81,11 @@ nsresult nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
|
|||
mEventChars = mEventString.ToNewCString();
|
||||
|
||||
if (!JS_LookupProperty(mContext, mJSObj, mEventChars, &funval)) {
|
||||
delete[] mEventChars;
|
||||
nsCRT::free(mEventChars);
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
delete[] mEventChars;
|
||||
nsCRT::free(mEventChars);
|
||||
|
||||
if (JS_TypeOfValue(mContext, funval) != JSTYPE_FUNCTION) {
|
||||
return NS_OK;
|
||||
|
|
|
@ -704,7 +704,7 @@ nsHTMLFramesetFrame::ParseRowColSpec(nsString& aSpec,
|
|||
//aValues[i] = nsCRT::atoi(token); XXX this is broken, consequently the next 3 lines?
|
||||
char* tokenIso = token.ToNewCString();
|
||||
aSpecs[i].mValue = atoi(tokenIso);
|
||||
delete [] tokenIso;
|
||||
nsCRT::free(tokenIso);
|
||||
if (eFramesetUnit_Percent == aSpecs[i].mUnit) {
|
||||
if (aSpecs[i].mValue <= 0) {
|
||||
aSpecs[i].mValue = 100 / count;
|
||||
|
|
|
@ -704,7 +704,7 @@ nsHTMLFramesetFrame::ParseRowColSpec(nsString& aSpec,
|
|||
//aValues[i] = nsCRT::atoi(token); XXX this is broken, consequently the next 3 lines?
|
||||
char* tokenIso = token.ToNewCString();
|
||||
aSpecs[i].mValue = atoi(tokenIso);
|
||||
delete [] tokenIso;
|
||||
nsCRT::free(tokenIso);
|
||||
if (eFramesetUnit_Percent == aSpecs[i].mUnit) {
|
||||
if (aSpecs[i].mValue <= 0) {
|
||||
aSpecs[i].mValue = 100 / count;
|
||||
|
|
Загрузка…
Ссылка в новой задаче