THRIFT-2275 Fix memory leak in golang compact_protocol.
authorJens Geyer <jensg@apache.org>
Thu, 28 Nov 2013 20:15:17 +0000 (21:15 +0100)
committerJens Geyer <jensg@apache.org>
Thu, 28 Nov 2013 20:15:17 +0000 (21:15 +0100)
Patch: bolin huang

lib/go/thrift/compact_protocol.go

index 74d36d0..f89fc2f 100644 (file)
@@ -352,6 +352,7 @@ func (p *TCompactProtocol) ReadStructBegin() (name string, err error) {
 func (p *TCompactProtocol) ReadStructEnd() error {
        // consume the last field we read off the wire.
        p.lastFieldId = p.lastField[len(p.lastField)-1]
+       p.lastField = p.lastField[:len(p.lastField)-1]
        return nil
 }