Fixed a couple of memory leaks
git-svn-id: svn://10.0.0.236/trunk@18996 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
2737ca110b
commit
1e954a0eb9
@ -429,7 +429,7 @@ nsTextControlFrame::PostCreateWidget(nsIPresContext* aPresContext,
|
||||
GetName(&name);
|
||||
|
||||
/* get url name */
|
||||
char *URLName;
|
||||
char *URLName = nsnull;
|
||||
nsIURL* docURL = nsnull;
|
||||
nsIDocument* doc = nsnull;
|
||||
mContent->GetDocument(doc);
|
||||
@ -450,10 +450,13 @@ nsTextControlFrame::PostCreateWidget(nsIPresContext* aPresContext,
|
||||
(nsISupports **)&service);
|
||||
if ((NS_OK == res) && (nsnull != service)) {
|
||||
char* valueString = NULL;
|
||||
res = service->SI_RestoreSignonData(URLName, name.ToNewCString(), &valueString);
|
||||
char* nameString = name.ToNewCString();
|
||||
res = service->SI_RestoreSignonData(URLName, nameString, &valueString);
|
||||
delete[] nameString;
|
||||
NS_RELEASE(service);
|
||||
PR_FREEIF(URLName);
|
||||
if (valueString && *valueString) {
|
||||
value = nsAutoString(valueString);
|
||||
value = valueString;
|
||||
} else {
|
||||
GetText(&value, PR_TRUE);
|
||||
}
|
||||
|
||||
@ -429,7 +429,7 @@ nsTextControlFrame::PostCreateWidget(nsIPresContext* aPresContext,
|
||||
GetName(&name);
|
||||
|
||||
/* get url name */
|
||||
char *URLName;
|
||||
char *URLName = nsnull;
|
||||
nsIURL* docURL = nsnull;
|
||||
nsIDocument* doc = nsnull;
|
||||
mContent->GetDocument(doc);
|
||||
@ -450,10 +450,13 @@ nsTextControlFrame::PostCreateWidget(nsIPresContext* aPresContext,
|
||||
(nsISupports **)&service);
|
||||
if ((NS_OK == res) && (nsnull != service)) {
|
||||
char* valueString = NULL;
|
||||
res = service->SI_RestoreSignonData(URLName, name.ToNewCString(), &valueString);
|
||||
char* nameString = name.ToNewCString();
|
||||
res = service->SI_RestoreSignonData(URLName, nameString, &valueString);
|
||||
delete[] nameString;
|
||||
NS_RELEASE(service);
|
||||
PR_FREEIF(URLName);
|
||||
if (valueString && *valueString) {
|
||||
value = nsAutoString(valueString);
|
||||
value = valueString;
|
||||
} else {
|
||||
GetText(&value, PR_TRUE);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user