[TD-225]fix potential memory leak.

This commit is contained in:
Haojun Liao 2021-01-29 11:31:16 +08:00
parent bdaa824802
commit cbb728946a
1 changed files with 2 additions and 1 deletions

View File

@ -191,7 +191,8 @@ double tbufReadDouble(SBufferReader* buf) {
// writer functions
void tbufCloseWriter( SBufferWriter* buf ) {
(*buf->allocator)( buf->data, 0 );
tfree(buf->data);
// (*buf->allocator)( buf->data, 0 ); // potential memory leak.
buf->data = NULL;
buf->pos = 0;
buf->size = 0;