return rv;
rv = regerr2nsresult( err ); if ( rv != NS_OK ) {  PR_Free( *result ); *result = 0; } } else { rv = NS_ERROR_OUT_OF_MEMORY; } } } else {  rv = regerr2nsresult( err ); }  return rv;
NS_IMETHODIMP nsRegistry::GetString(nsRegistryKey baseKey, const PRUnichar *valname, PRUnichar **_retval){    // Make sure caller gave us place for result.    if ( !valname || !_retval )        return NS_ERROR_NULL_POINTER;    // initialize the return value    *_retval = nsnull;    nsXPIDLCString tmpstr;    nsresult rv = GetStringUTF8( baseKey, NS_ConvertUCS2toUTF8(valname).get(), getter_Copies(tmpstr) );    if (NS_SUCCEEDED(rv))    {        *_retval = nsTextFormatter::smprintf( widestrFormat, tmpstr.get() );        if ( *_retval == nsnull )            rv = NS_ERROR_OUT_OF_MEMORY;    }    return rv;}