Tencent / TBase

TBase is an enterprise-level distributed HTAP database. Through a single database cluster to provide users with highly consistent distributed database services and high-performance data warehouse services, a set of integrated enterprise-level solutions is formed.
Other
1.38k stars 262 forks source link

Resource leak #48

Closed QiAnXinCodeSafe closed 4 years ago

QiAnXinCodeSafe commented 4 years ago

Stream is opened https://github.com/Tencent/TBase/blob/3295393cbabd6f17676c53078cf4cc03aa9dc1fd/src/bin/confmod/confmod.c#L236

Opened file never closed https://github.com/Tencent/TBase/blob/3295393cbabd6f17676c53078cf4cc03aa9dc1fd/src/bin/confmod/confmod.c#L255

JennyJennyChen commented 4 years ago

g_confpf is a global variable, here it is only responsible for opening, other places are responsible for using it, it will be closed after use, so there is no resource leakage problem

JennyJennyChen commented 4 years ago

function "create_new_conf_file" to be closed the g_confpf