Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(wechat_qrcode): fixed memory leaks #3484

Merged
merged 1 commit into from Apr 28, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
fix(wechat_qrcode): fixed memory leaks
  • Loading branch information
Konano committed Apr 27, 2023
commit 2b62ff6181163eea029ed1cab11363b4996e9cd6
Expand Up @@ -127,7 +127,10 @@ void DecodedBitStreamParser::decodeHanziSegment(Ref<BitSource> bits_, string& re
while (count > 0) {
// Each 13 bits encodes a 2-byte character
int twoBytes = bits.readBits(13, err_handler);
if (err_handler.ErrCode()) return;
if (err_handler.ErrCode()) {
delete[] buffer;
return;
}
int assembledTwoBytes = ((twoBytes / 0x060) << 8) | (twoBytes % 0x060);
if (assembledTwoBytes < 0x003BF) {
// In the 0xA1A1 to 0xAAFE range
Expand Down