Browse Source

Fix possible memory leaks

Fix possible memory leaks
wincsb 1 year ago
parent
commit
b478c278a2
1 changed files with 2 additions and 2 deletions
  1. 2 2
      util/src/tc_network_buffer.cpp

+ 2 - 2
util/src/tc_network_buffer.cpp

@@ -1,4 +1,4 @@
-/**
+/**
  * Tencent is pleased to support the open source community by making Tars available.
  *
  * Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.
@@ -41,7 +41,7 @@ void TC_NetWorkBuffer::Buffer::alloc(size_t len)
 		_capacity = len;
 		if(_buffer)
 		{
-			delete _buffer;
+			delete[] _buffer;
 			_buffer = NULL;
 		}
 	}