Skip to content

Memory Leak in Swagger doc #379

@maiconsi

Description

@maiconsi

Identify some memory leaks in the Swagger classes.
Follow the corrections.
File: Swag.Doc.pas
Line: 261
Result.AddPair(fDefinitions.Items[vIndex].Name, fDefinitions.Items[vIndex].JsonSchema.Clone as TJSONObject);


File: Swag.Doc.Defnition.pas
Line: 73

if Assigned(fJsonSchema) then
    FreeAndNil(fJsonSchema);

File: Swag.Doc.Path.Operation.RequestParameter.pas
Line: 208
vJsonObject.AddPair(c_SwagRequestParameterSchema, fSchema.JsonSchema.Clone as TJSONObject);
File: Swag.Doc.Path.Operation.Response.pas
Line: 147
vJsonObject.AddPair(c_SwagResponseSchema, fSchema.JsonSchema.Clone as TJSONObject);
Line: 189
fSchema.JsonSchema := pJson.Values[c_SwagResponseSchema].Clone as TJSONObject;

Source.zip

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions