Skip to content

Commit

Permalink
fix(wechat_qrcode): fixed memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
Konano committed Apr 27, 2023
1 parent ccc2772 commit 2b62ff6
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
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

0 comments on commit 2b62ff6

Please sign in to comment.