[SERVER-74889] Fix memory leak in SBE setField Created: 15/Mar/23  Updated: 29/Oct/23  Resolved: 23/Mar/23

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 7.0.0-rc0

Type: Bug Priority: Major - P3
Reporter: Matt Boros Assignee: Amr Elhelw
Resolution: Fixed Votes: 0
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Query Execution
Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: QE 2023-04-03
Participants:

 Description   

The early return in ByteCode::setField would lead to a memory leak. newTag, newVal would not be deleted. A value guard should be added.

I don't think there is a way to pass setField a non-string field, so this isn't being hit, which is why we aren't seeing the issue in ASAN.



 Comments   
Comment by Githook User [ 23/Mar/23 ]

Author:

{'name': 'Amr Elhelw', 'email': 'amr.elhelw@mongodb.com', 'username': 'aelhelw'}

Message: SERVER-74889 Add value guard to avoid memory leak in SBE setField
Branch: master
https://github.com/mongodb/mongo/commit/819ffdee0fb53ce7862c9f30ab763a103e42330b

Generated at Thu Feb 08 06:28:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.