• Joshua Rubin's avatar
    net/http: fix minor leak in Header.WriteSubset · a4d03a9b
    Joshua Rubin authored
    Header.WriteSubset uses a sync.Pool but wouldn't Put the sorter back in
    the pool if there was an error writing to the io.Writer
    
    I'm not really sure why the sorter is returned to begin with. The
    comment says "for possible return to headerSorterCache".
    
    This also doesn't address potential panics that might occur, but the
    overhead of doing the Put in a defer would likely be too great.
    
    Change-Id: If3c45a4c3e11f6ec65d187e25b63455b0142d4e3
    Reviewed-on: https://go-review.googlesource.com/73910
    Run-TryBot: Ian Lance Taylor <iant@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarTom Bergan <tombergan@google.com>
    a4d03a9b
header.go 5.99 KB