From bf5fd74a8e5ccb525d08a8db775a2865469b856a Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sun, 7 Jan 2018 22:33:51 -0800 Subject: [PATCH] fix defered unlock of pin lock in AddR This wasn't causing any problems because this function is actually dead code (but possibly useful?). License: MIT Signed-off-by: Steven Allen --- core/coreunix/add.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/coreunix/add.go b/core/coreunix/add.go index 6e74f5b0347..0d4e816f6ab 100644 --- a/core/coreunix/add.go +++ b/core/coreunix/add.go @@ -322,7 +322,7 @@ func AddWithContext(ctx context.Context, n *core.IpfsNode, r io.Reader) (string, // AddR recursively adds files in |path|. func AddR(n *core.IpfsNode, root string) (key string, err error) { - n.Blockstore.PinLock().Unlock() + defer n.Blockstore.PinLock().Unlock() stat, err := os.Lstat(root) if err != nil {