Skip to content

Commit d40fb43

Browse files
committed
* Fixed internal/xstrings.Buffer() leak without call buffer.Free()
1 parent 2303ce2 commit d40fb43

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
* Fixed `internal/xstrings.Buffer()` leak without call `buffer.Free()`
2+
13
## v3.75.2
24
* Fixed build for go1.20
35

internal/xerrors/issues.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func (e *withIssuesError) isYdbError() {}
7777

7878
func (e *withIssuesError) Error() string {
7979
b := xstring.Buffer()
80+
defer b.Free()
8081
if len(e.reason) > 0 {
8182
b.WriteString(e.reason)
8283
b.WriteString(", issues: [")

internal/xerrors/retryable.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ func (re *retryableError) IsRetryObjectValid() bool {
3939

4040
func (re *retryableError) Error() string {
4141
b := xstring.Buffer()
42+
defer b.Free()
4243
b.WriteString(re.Name())
4344
fmt.Fprintf(b, " (code = %d, source error = %q", re.code, re.err.Error())
4445
if len(re.traceID) > 0 {

internal/xerrors/transport.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ func WithNodeID(nodeID uint32) nodeIDOption {
6161

6262
func (e *transportError) Error() string {
6363
b := xstring.Buffer()
64+
defer b.Free()
6465
b.WriteString(e.Name())
6566
fmt.Fprintf(b, " (code = %d, source error = %q", e.status.Code(), e.err.Error())
6667
if len(e.address) > 0 {

0 commit comments

Comments
 (0)