Skip to content

Commit d779979

Browse files
Potential fix for code scanning alert no. 5749: Resource not released in destructor
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent f1ab1a6 commit d779979

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

Common/include/option_structure.inl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1319,7 +1319,20 @@ class COptionWallSpecies : public COptionBase {
13191319
this->name = option_field_name;
13201320
this->m = m;
13211321
}
1322-
~COptionWallSpecies() override{};
1322+
~COptionWallSpecies() override {
1323+
if (marker) {
1324+
delete[] marker;
1325+
marker = nullptr;
1326+
}
1327+
if (field) {
1328+
delete[] field;
1329+
field = nullptr;
1330+
}
1331+
if (value) {
1332+
delete[] value;
1333+
value = nullptr;
1334+
}
1335+
}
13231336

13241337
string SetValue(const vector<string>& option_value) override {
13251338
COptionBase::SetValue(option_value);

0 commit comments

Comments
 (0)