mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-03 07:01:19 +00:00
Bug 89184. Use nsXPIDLCString instead of uninitialized bare |char*|. r=dbaron, sr=jst.
This commit is contained in:
parent
c8f15c867c
commit
e79aa1d781
@ -616,16 +616,15 @@ nsHTMLAnchorElement::GetHash(nsAWritableString& aHash)
|
||||
result = NS_NewURI(getter_AddRefs(uri), href);
|
||||
|
||||
if (NS_OK == result) {
|
||||
char *ref;
|
||||
nsXPIDLCString ref;
|
||||
nsCOMPtr<nsIURL> url(do_QueryInterface(uri));
|
||||
if (url) {
|
||||
result = url->GetRef(&ref);
|
||||
result = url->GetRef(getter_Copies(ref));
|
||||
}
|
||||
|
||||
if (result == NS_OK && (nsnull != ref) && ('\0' != *ref)) {
|
||||
aHash.Assign(PRUnichar('#'));
|
||||
aHash.Append(NS_ConvertASCIItoUCS2(ref));
|
||||
nsCRT::free(ref);
|
||||
}
|
||||
else {
|
||||
aHash.SetLength(0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user