Skip to content

Commit 49d103f

Browse files
authored
Merge pull request #1351 from ydb-platform/buffer
* Fixed `internal/xstrings.Buffer()` leak without call `buffer.Free()`
2 parents a70a04e + 639231c commit 49d103f

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
* Fixed `internal/xstrings.Buffer()` leak without call `buffer.Free()`
12
* Removed double quotas from goroutine labels background workers for prevent problem with pprof
23

34
## v3.75.2

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)