Fix mainshareKR bug

This commit is contained in:
Chun-Hung Tseng
2023-06-30 14:14:26 +02:00
parent 208b70cfd4
commit a4e81165f9

View File

@@ -10,7 +10,7 @@ import (
func (protonDrive *ProtonDrive) getNodeKRByID(ctx context.Context, linkID string) (*crypto.KeyRing, error) {
if linkID == "" {
// most likely someone requested parent link, which happen to be ""
return protonDrive.MainShareKR, nil
return protonDrive.MainShareKR.Copy() // we need to return a deep copy since the keyring will be freed by the caller when it finishes using the keyring
}
link, err := protonDrive.c.GetLink(ctx, protonDrive.MainShare.ShareID, linkID)