Bug #106952 it is better to clear upd_t in trx_undo_prev_version_build
Submitted: 8 Apr 2022 6:01 Modified: 16 Aug 2022 18:25
Reporter: alex xing (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:8.0.28 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[8 Apr 2022 6:01] alex xing
Description:
The original logic may cause memory leaks.
So in trx_undo_prev_version_build, if missing_extern, it is better to clear upd_t before return.

How to repeat:
just read the code

Suggested fix:
in trx_undo_prev_version_build, if missing_extern, it is better to clear upd_t before return, just as the below patch
[8 Apr 2022 6:01] alex xing
a simple patch to describe the optimization

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: optimize.patch (text/plain), 488 bytes.

[8 Apr 2022 6:55] MySQL Verification Team
Hello Alex Xing,

Thank you for the report and contribution.

regards,
umesh
[16 Aug 2022 18:25] Daniel Price
Posted by developer:
 
Fixed as of the upcoming 8.0.31 release:

A potential memory leak in the trx_undo_prev_version_build() function was
corrected. 

Thanks to Alex Xing for the contribution.