mirror of
https://github.com/vlang/v.git
synced 2025-09-15 15:32:27 +03:00
strings: fix a leak in builder
This commit is contained in:
parent
d43722fa85
commit
e78dc4d682
1 changed files with 2 additions and 2 deletions
|
@ -115,9 +115,9 @@ pub fn (mut b Builder) str() string {
|
||||||
}
|
}
|
||||||
b.buf << `\0`
|
b.buf << `\0`
|
||||||
s := string(b.buf,b.len)
|
s := string(b.buf,b.len)
|
||||||
bis := b.initial_size
|
//bis := b.initial_size
|
||||||
//free(b.buf.data)
|
//free(b.buf.data)
|
||||||
b.buf = []byte{cap: bis}
|
//b.buf = []byte{cap: bis}
|
||||||
b.len = 0
|
b.len = 0
|
||||||
return s
|
return s
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue