зеркало из https://github.com/mozilla/gecko-dev.git
warren's fix for the new/free mismatch undid kin's fix for the same problem. Also fix an off by one in the backwards 'for' loop. r=warren
This commit is contained in:
Родитель
4b900e3e5a
Коммит
2730e37efd
|
@ -672,7 +672,7 @@ nsJARChannel::GetContentType(char* *aContentType)
|
||||||
if (fileName != nsnull) {
|
if (fileName != nsnull) {
|
||||||
PRInt32 len = nsCRT::strlen(fileName);
|
PRInt32 len = nsCRT::strlen(fileName);
|
||||||
const char* ext = nsnull;
|
const char* ext = nsnull;
|
||||||
for (PRInt32 i = len; i >= 0; i--) {
|
for (PRInt32 i = len-1; i >= 0; i--) {
|
||||||
if (fileName[i] == '.') {
|
if (fileName[i] == '.') {
|
||||||
ext = &fileName[i + 1];
|
ext = &fileName[i + 1];
|
||||||
break;
|
break;
|
||||||
|
@ -688,7 +688,7 @@ nsJARChannel::GetContentType(char* *aContentType)
|
||||||
else
|
else
|
||||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
delete []fileName;
|
nsCRT::free(fileName);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rv = NS_ERROR_FAILURE;
|
rv = NS_ERROR_FAILURE;
|
||||||
|
|
|
@ -672,7 +672,7 @@ nsJARChannel::GetContentType(char* *aContentType)
|
||||||
if (fileName != nsnull) {
|
if (fileName != nsnull) {
|
||||||
PRInt32 len = nsCRT::strlen(fileName);
|
PRInt32 len = nsCRT::strlen(fileName);
|
||||||
const char* ext = nsnull;
|
const char* ext = nsnull;
|
||||||
for (PRInt32 i = len; i >= 0; i--) {
|
for (PRInt32 i = len-1; i >= 0; i--) {
|
||||||
if (fileName[i] == '.') {
|
if (fileName[i] == '.') {
|
||||||
ext = &fileName[i + 1];
|
ext = &fileName[i + 1];
|
||||||
break;
|
break;
|
||||||
|
@ -688,7 +688,7 @@ nsJARChannel::GetContentType(char* *aContentType)
|
||||||
else
|
else
|
||||||
rv = NS_ERROR_OUT_OF_MEMORY;
|
rv = NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
|
||||||
delete []fileName;
|
nsCRT::free(fileName);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
rv = NS_ERROR_FAILURE;
|
rv = NS_ERROR_FAILURE;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче