fix: cover image memory leak
Signed-off-by: 鲁树人 <lu.shuren@um-react.app>
This commit is contained in:
parent
2b52a367f2
commit
f58c6c3880
|
@ -403,10 +403,8 @@ NeteaseCrypt::NeteaseCrypt(std::string const &path)
|
|||
|
||||
if (n > 0)
|
||||
{
|
||||
char *imageData = (char *)malloc(n);
|
||||
read(imageData, n);
|
||||
|
||||
mImageData = std::string(imageData, n);
|
||||
mImageData = std::string(n, '\0');
|
||||
read(&mImageData[0], n);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue