From a4e81165f9da0a2015d2a567a51b7192e9a73404 Mon Sep 17 00:00:00 2001 From: Chun-Hung Tseng Date: Fri, 30 Jun 2023 14:14:26 +0200 Subject: [PATCH] Fix mainshareKR bug --- keyring.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyring.go b/keyring.go index abc3a15..f8de460 100644 --- a/keyring.go +++ b/keyring.go @@ -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)