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 <steven@stebalien.com>
Steven Allen committed
Jan 7, 2018 at 22:33 UTC
bf5fd74a8e5ccb525d08a8db775a2865469b856a
1 file changed
+1
-1
core/coreunix/add.go
+1
-1
@@ -322,7 +322,7 @@ func AddWithContext(ctx context.Context, n *core.IpfsNode, r io.Reader) (string,
322
323
// AddR recursively adds files in |path|.
324
func AddR(n *core.IpfsNode, root string) (key string, err error) {
325
- n.Blockstore.PinLock().Unlock()
325
+ defer n.Blockstore.PinLock().Unlock()
326
327
stat, err := os.Lstat(root)
328
if err != nil {