[TD-225]fix potential memory leak.
This commit is contained in:
parent
bdaa824802
commit
cbb728946a
|
@ -191,7 +191,8 @@ double tbufReadDouble(SBufferReader* buf) {
|
||||||
// writer functions
|
// writer functions
|
||||||
|
|
||||||
void tbufCloseWriter( SBufferWriter* buf ) {
|
void tbufCloseWriter( SBufferWriter* buf ) {
|
||||||
(*buf->allocator)( buf->data, 0 );
|
tfree(buf->data);
|
||||||
|
// (*buf->allocator)( buf->data, 0 ); // potential memory leak.
|
||||||
buf->data = NULL;
|
buf->data = NULL;
|
||||||
buf->pos = 0;
|
buf->pos = 0;
|
||||||
buf->size = 0;
|
buf->size = 0;
|
||||||
|
|
Loading…
Reference in New Issue