Fix a memory leak in NetworkClient

This commit is contained in:
k1-801 2021-04-25 04:54:35 +04:00 committed by Adam Honse
parent dd4865c3e0
commit 402423e338

View file

@ -918,9 +918,7 @@ std::vector<std::string> * NetworkClient::ProcessReply_ProfileList(unsigned int
memcpy(&name_len, data, sizeof(unsigned short)); memcpy(&name_len, data, sizeof(unsigned short));
data_ptr += sizeof(unsigned short); data_ptr += sizeof(unsigned short);
char * profile_name = new char[name_len]; std::string profile_name(data, name_len);
memcpy(&profile_name, data, name_len);
profile_list->push_back(profile_name); profile_list->push_back(profile_name);
data_ptr += name_len; data_ptr += name_len;