fix: cover image memory leak

Signed-off-by: 鲁树人 <lu.shuren@um-react.app>
This commit is contained in:
鲁树人 2024-09-13 00:01:26 +01:00
parent 2b52a367f2
commit f58c6c3880
No known key found for this signature in database
1 changed files with 2 additions and 4 deletions

View File

@ -403,10 +403,8 @@ NeteaseCrypt::NeteaseCrypt(std::string const &path)
if (n > 0) if (n > 0)
{ {
char *imageData = (char *)malloc(n); mImageData = std::string(n, '\0');
read(imageData, n); read(&mImageData[0], n);
mImageData = std::string(imageData, n);
} }
else else
{ {