Skip to content

missing unlock in crypt/rand/rand_unix.go #917

Closed
@bradfitz

Description

@bradfitz
Just noticed on ,

http://code.google.com/p/go/source/browse/src/pkg/crypto/rand/rand_unix.go?spec=svn42e4767b10beb7eeb7a3c7db372279e8c01b45c3&;r=42e4767b10beb7eeb7a3c7db372279e8c01b45c3


func (r *devReader) Read(b []byte) (n int, err os.Error) {
    r.mu.Lock()
    if r.f == nil {
        f, err := os.Open(r.name, os.O_RDONLY, 0)
        if f == nil {
>>>>>>>>>>>>>>>>>>>>>>>
/// MISSING m.mu.Unlock()
            return 0, err
        }
        r.f = f
    }
    r.mu.Unlock()
    return r.f.Read(b)
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions