View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0006299 | JEDI VCL | 00 JVCL Components | public | 2014-06-20 13:15 | 2014-08-31 22:41 |
Reporter | ZENsan | Assigned To | |||
Priority | normal | Severity | tweak | Reproducibility | always |
Status | acknowledged | Resolution | open | ||
Platform | Windows | OS | Windows 7 | OS Version | |
Product Version | Daily / GIT | ||||
Target Version | Fixed in Version | ||||
Summary | 0006299: Unsafe pattern in function | ||||
Description | function TJvCheckListBox.GetChecked: TStringList; function TJvCheckListBox.GetUnChecked: TStringList; These function uses a bit unsafe handling of the result. Actual: var I: Integer; begin Result := TStringList.Create; for I := 0 to Items.Count - 1 do if Checked[I] then Result.AddObject(Items[I], Items.Objects[I]); end; Expected: var I: Integer; begin Result := TStringList.Create; try for I := 0 to Items.Count - 1 do if Checked[I] then Result.AddObject(Items[I], Items.Objects[I]); except Result.Free; raise; end; end; Quite minor, but in case of out of memory these produces the memory leak. Possibly there are some similar places. | ||||
Additional Information | Quite rare case, but still theoretically and practically possible. | ||||
Tags | No tags attached. | ||||