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)
|
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
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue