diff --git a/server/accounts.go b/server/accounts.go index 3217d5cf8f2..33f926b10c5 100644 --- a/server/accounts.go +++ b/server/accounts.go @@ -3869,7 +3869,7 @@ func fetchAccount(res AccountResolver, name string) (string, error) { if !nkeys.IsValidPublicAccountKey(name) { return _EMPTY_, fmt.Errorf("will only fetch valid account keys") } - return res.Fetch(name) + return res.Fetch(copyString(name)) } // AccountResolver interface. This is to fetch Account JWTs by public nkeys diff --git a/server/client.go b/server/client.go index e5b08c3f42f..be1f72ef10d 100644 --- a/server/client.go +++ b/server/client.go @@ -5668,7 +5668,7 @@ func (c *client) getAccAndResultFromCache() (*Account, *SublistResult) { } } else { // Match correct account and sublist. - if acc, _ = c.srv.LookupAccount(string(c.pa.account)); acc == nil { + if acc, _ = c.srv.LookupAccount(bytesToString(c.pa.account)); acc == nil { return nil, nil } }