diff --git a/api/geth_backend.go b/api/geth_backend.go index 83a77f72a..d2953a3e7 100644 --- a/api/geth_backend.go +++ b/api/geth_backend.go @@ -1090,10 +1090,14 @@ func (b *GethStatusBackend) createTempDBFile(pattern string) (tmpDbPath string, if err != nil { return } + err = file.Close() + if err != nil { + return + } + tmpDbPath = file.Name() cleanup = func() { filePath := file.Name() - _ = file.Close() _ = os.Remove(filePath) _ = os.Remove(filePath + "-wal") _ = os.Remove(filePath + "-shm")