Document that Decode* must not keep src
- Also fix Bytea.DecodeBinary to not keep src.
This commit is contained in:
+4
-1
@@ -106,7 +106,10 @@ func (dst *Bytea) DecodeBinary(src []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
*dst = Bytea{Bytes: src, Status: Present}
|
||||
buf := make([]byte, len(src))
|
||||
copy(buf, src)
|
||||
|
||||
*dst = Bytea{Bytes: buf, Status: Present}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user