Use nsCRT::free() instead of delete[] for char* data.
This commit is contained in:
@@ -1101,7 +1101,7 @@ GlobalWindowImpl::Dump(const nsString& aStr)
|
|||||||
|
|
||||||
if (nsnull != cstr) {
|
if (nsnull != cstr) {
|
||||||
printf("%s", cstr);
|
printf("%s", cstr);
|
||||||
delete [] cstr;
|
nsCRT::free(cstr);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@@ -2438,7 +2438,7 @@ GlobalWindowImpl::CheckWindowName(JSContext *cx, nsString& aName)
|
|||||||
JS_ReportError(cx,
|
JS_ReportError(cx,
|
||||||
"illegal character '%c' ('\\%o') in window name %s",
|
"illegal character '%c' ('\\%o') in window name %s",
|
||||||
mChar, mChar, cp);
|
mChar, mChar, cp);
|
||||||
delete [] cp;
|
nsCRT::free(cp);
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ nsDOMNativeObjectRegistry::RemoveStrings(PLHashEntry *he, PRIntn i, void *arg)
|
|||||||
{
|
{
|
||||||
char *str = (char *)he->key;
|
char *str = (char *)he->key;
|
||||||
|
|
||||||
delete [] str;
|
nsCRT::free(str);
|
||||||
return HT_ENUMERATE_REMOVE;
|
return HT_ENUMERATE_REMOVE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -183,7 +183,7 @@ nsDOMNativeObjectRegistry::GetFactoryCID(const nsString& aClassName,
|
|||||||
|
|
||||||
char *name = aClassName.ToNewCString();
|
char *name = aClassName.ToNewCString();
|
||||||
nsIID *classId = (nsIID *)PL_HashTableLookup(mFactories, name);
|
nsIID *classId = (nsIID *)PL_HashTableLookup(mFactories, name);
|
||||||
delete[] name;
|
nsCRT::free(name);
|
||||||
|
|
||||||
aCID = *classId;
|
aCID = *classId;
|
||||||
|
|
||||||
@@ -378,7 +378,7 @@ nsDOMScriptObjectFactory::NewScriptElement(const nsString &aTagName,
|
|||||||
nsDOMHTMLTag tag = NS_DOMTagToEnum(str);
|
nsDOMHTMLTag tag = NS_DOMTagToEnum(str);
|
||||||
|
|
||||||
if (str) {
|
if (str) {
|
||||||
delete[] str;
|
nsCRT::free(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (tag) {
|
switch (tag) {
|
||||||
|
|||||||
@@ -81,11 +81,11 @@ nsresult nsJSEventListener::HandleEvent(nsIDOMEvent* aEvent)
|
|||||||
mEventChars = mEventString.ToNewCString();
|
mEventChars = mEventString.ToNewCString();
|
||||||
|
|
||||||
if (!JS_LookupProperty(mContext, mJSObj, mEventChars, &funval)) {
|
if (!JS_LookupProperty(mContext, mJSObj, mEventChars, &funval)) {
|
||||||
delete[] mEventChars;
|
nsCRT::free(mEventChars);
|
||||||
return NS_ERROR_FAILURE;
|
return NS_ERROR_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete[] mEventChars;
|
nsCRT::free(mEventChars);
|
||||||
|
|
||||||
if (JS_TypeOfValue(mContext, funval) != JSTYPE_FUNCTION) {
|
if (JS_TypeOfValue(mContext, funval) != JSTYPE_FUNCTION) {
|
||||||
return NS_OK;
|
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?
|
//aValues[i] = nsCRT::atoi(token); XXX this is broken, consequently the next 3 lines?
|
||||||
char* tokenIso = token.ToNewCString();
|
char* tokenIso = token.ToNewCString();
|
||||||
aSpecs[i].mValue = atoi(tokenIso);
|
aSpecs[i].mValue = atoi(tokenIso);
|
||||||
delete [] tokenIso;
|
nsCRT::free(tokenIso);
|
||||||
if (eFramesetUnit_Percent == aSpecs[i].mUnit) {
|
if (eFramesetUnit_Percent == aSpecs[i].mUnit) {
|
||||||
if (aSpecs[i].mValue <= 0) {
|
if (aSpecs[i].mValue <= 0) {
|
||||||
aSpecs[i].mValue = 100 / count;
|
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?
|
//aValues[i] = nsCRT::atoi(token); XXX this is broken, consequently the next 3 lines?
|
||||||
char* tokenIso = token.ToNewCString();
|
char* tokenIso = token.ToNewCString();
|
||||||
aSpecs[i].mValue = atoi(tokenIso);
|
aSpecs[i].mValue = atoi(tokenIso);
|
||||||
delete [] tokenIso;
|
nsCRT::free(tokenIso);
|
||||||
if (eFramesetUnit_Percent == aSpecs[i].mUnit) {
|
if (eFramesetUnit_Percent == aSpecs[i].mUnit) {
|
||||||
if (aSpecs[i].mValue <= 0) {
|
if (aSpecs[i].mValue <= 0) {
|
||||||
aSpecs[i].mValue = 100 / count;
|
aSpecs[i].mValue = 100 / count;
|
||||||
|
|||||||
Reference in New Issue
Block a user